From fe8a42d97677c24903afffb244cb1d1fec54090c Mon Sep 17 00:00:00 2001 From: Alejandro Ranchal-Pedrosa Date: Sat, 9 Sep 2023 18:09:20 +0200 Subject: [PATCH 1/6] Implement Granite msg protos (trying to depend as little as possible from Mir --- pkg/net/grpc/grpctransport.pb.go | 4 +- pkg/net/grpc/grpctransport_grpc.pb.go | 4 + pkg/pb/apppb/apppb.pb.go | 4 +- pkg/pb/availabilitypb/availabilitypb.pb.go | 4 +- .../availabilitypb/batchdbpb/batchdbpb.pb.go | 4 +- pkg/pb/availabilitypb/mscpb/mscpb.pb.go | 4 +- pkg/pb/batchfetcherpb/batchfetcherpb.pb.go | 4 +- pkg/pb/bcbpb/bcbpb.pb.go | 4 +- pkg/pb/checkpointpb/checkpointpb.pb.go | 4 +- .../chkpvalidatorpb/chkpvalidatorpb.pb.go | 4 +- pkg/pb/contextstorepb/contextstorepb.pb.go | 4 +- pkg/pb/cryptopb/cryptopb.pb.go | 4 +- pkg/pb/dslpb/dslpb.pb.go | 4 +- pkg/pb/eventpb/eventpb.pb.go | 18 +- pkg/pb/factorypb/factorypb.pb.go | 169 ++-- pkg/pb/factorypb/factorypb.pb.mir.go | 1 + pkg/pb/factorypb/oneof_interfaces.mir.go | 5 + pkg/pb/factorypb/types/types.mir.go | 27 + pkg/pb/granitepb/dsl/messages.mir.go | 61 ++ pkg/pb/granitepb/granitepb.pb.go | 952 ++++++++++++++++++ pkg/pb/granitepb/granitepb.pb.mir.go | 18 + pkg/pb/granitepb/msgs/msgs.mir.go | 114 +++ pkg/pb/granitepb/oneof_interfaces.mir.go | 34 + pkg/pb/granitepb/types/types.mir.go | 501 +++++++++ pkg/pb/hasherpb/hasherpb.pb.go | 4 +- pkg/pb/isspb/isspb.pb.go | 4 +- pkg/pb/mempoolpb/mempoolpb.pb.go | 4 +- pkg/pb/messagepb/messagepb.pb.go | 107 +- pkg/pb/messagepb/messagepb.pb.mir.go | 1 + pkg/pb/messagepb/oneof_interfaces.mir.go | 5 + pkg/pb/messagepb/types/types.mir.go | 27 + pkg/pb/mir/codegen_extensions.pb.go | 40 +- pkg/pb/net/codegen_extensions.pb.go | 22 +- pkg/pb/ordererpb/ordererpb.pb.go | 4 +- .../pprepvalidatorpb/pprepvalidatorpb.pb.go | 4 +- pkg/pb/pbftpb/pbftpb.pb.go | 4 +- pkg/pb/pingpongpb/pingpongpb.pb.go | 4 +- pkg/pb/recordingpb/recordingpb.pb.go | 4 +- pkg/pb/testerpb/testerpb.pb.go | 4 +- pkg/pb/threshcryptopb/threshcryptopb.pb.go | 4 +- pkg/pb/transportpb/transportpb.pb.go | 4 +- pkg/pb/trantorpb/trantorpb.pb.go | 4 +- .../transactionreceiver.pb.go | 4 +- .../transactionreceiver_grpc.pb.go | 4 + protos/factorypb/factorypb.proto | 3 +- protos/generate.go | 4 + protos/granitepb/granitepb.proto | 87 ++ protos/messagepb/messagepb.proto | 2 + 48 files changed, 2100 insertions(+), 206 deletions(-) create mode 100644 pkg/pb/granitepb/dsl/messages.mir.go create mode 100644 pkg/pb/granitepb/granitepb.pb.go create mode 100644 pkg/pb/granitepb/granitepb.pb.mir.go create mode 100644 pkg/pb/granitepb/msgs/msgs.mir.go create mode 100644 pkg/pb/granitepb/oneof_interfaces.mir.go create mode 100644 pkg/pb/granitepb/types/types.mir.go create mode 100644 protos/granitepb/granitepb.proto diff --git a/pkg/net/grpc/grpctransport.pb.go b/pkg/net/grpc/grpctransport.pb.go index 4d1221563..c23082f41 100644 --- a/pkg/net/grpc/grpctransport.pb.go +++ b/pkg/net/grpc/grpctransport.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: net/grpc/grpctransport.proto package grpc diff --git a/pkg/net/grpc/grpctransport_grpc.pb.go b/pkg/net/grpc/grpctransport_grpc.pb.go index ba59dbbbe..57d61cd29 100644 --- a/pkg/net/grpc/grpctransport_grpc.pb.go +++ b/pkg/net/grpc/grpctransport_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: net/grpc/grpctransport.proto package grpc diff --git a/pkg/pb/apppb/apppb.pb.go b/pkg/pb/apppb/apppb.pb.go index e06601992..6b6db8d4b 100644 --- a/pkg/pb/apppb/apppb.pb.go +++ b/pkg/pb/apppb/apppb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: apppb/apppb.proto package apppb diff --git a/pkg/pb/availabilitypb/availabilitypb.pb.go b/pkg/pb/availabilitypb/availabilitypb.pb.go index 28985f452..455dc3cd4 100644 --- a/pkg/pb/availabilitypb/availabilitypb.pb.go +++ b/pkg/pb/availabilitypb/availabilitypb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: availabilitypb/availabilitypb.proto package availabilitypb diff --git a/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go b/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go index 1aeb34ad7..f28106019 100644 --- a/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go +++ b/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: availabilitypb/batchdbpb/batchdbpb.proto package batchdbpb diff --git a/pkg/pb/availabilitypb/mscpb/mscpb.pb.go b/pkg/pb/availabilitypb/mscpb/mscpb.pb.go index b12d59ada..a3885ce80 100644 --- a/pkg/pb/availabilitypb/mscpb/mscpb.pb.go +++ b/pkg/pb/availabilitypb/mscpb/mscpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: availabilitypb/mscpb/mscpb.proto package mscpb diff --git a/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go b/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go index f67eaeecf..8a598b960 100644 --- a/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go +++ b/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: batchfetcherpb/batchfetcherpb.proto package batchfetcherpb diff --git a/pkg/pb/bcbpb/bcbpb.pb.go b/pkg/pb/bcbpb/bcbpb.pb.go index 67620e1e8..d1ee4d968 100644 --- a/pkg/pb/bcbpb/bcbpb.pb.go +++ b/pkg/pb/bcbpb/bcbpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: bcbpb/bcbpb.proto package bcbpb diff --git a/pkg/pb/checkpointpb/checkpointpb.pb.go b/pkg/pb/checkpointpb/checkpointpb.pb.go index c3e6da9de..1ce54771c 100644 --- a/pkg/pb/checkpointpb/checkpointpb.pb.go +++ b/pkg/pb/checkpointpb/checkpointpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: checkpointpb/checkpointpb.proto package checkpointpb diff --git a/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go b/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go index a3347588f..9db35822d 100644 --- a/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go +++ b/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: checkpointpb/chkpvalidatorpb/chkpvalidatorpb.proto package chkpvalidatorpb diff --git a/pkg/pb/contextstorepb/contextstorepb.pb.go b/pkg/pb/contextstorepb/contextstorepb.pb.go index 91d4deb90..c52e50a4f 100644 --- a/pkg/pb/contextstorepb/contextstorepb.pb.go +++ b/pkg/pb/contextstorepb/contextstorepb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: contextstorepb/contextstorepb.proto package contextstorepb diff --git a/pkg/pb/cryptopb/cryptopb.pb.go b/pkg/pb/cryptopb/cryptopb.pb.go index 8c1406f2f..6fe78da38 100644 --- a/pkg/pb/cryptopb/cryptopb.pb.go +++ b/pkg/pb/cryptopb/cryptopb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: cryptopb/cryptopb.proto package cryptopb diff --git a/pkg/pb/dslpb/dslpb.pb.go b/pkg/pb/dslpb/dslpb.pb.go index 9080eddbb..198ed330e 100644 --- a/pkg/pb/dslpb/dslpb.pb.go +++ b/pkg/pb/dslpb/dslpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: dslpb/dslpb.proto package dslpb diff --git a/pkg/pb/eventpb/eventpb.pb.go b/pkg/pb/eventpb/eventpb.pb.go index 4fbd16948..3a05b4fdf 100644 --- a/pkg/pb/eventpb/eventpb.pb.go +++ b/pkg/pb/eventpb/eventpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: eventpb/eventpb.proto package eventpb @@ -26,9 +26,9 @@ import ( testerpb "github.com/filecoin-project/mir/pkg/pb/testerpb" threshcryptopb "github.com/filecoin-project/mir/pkg/pb/threshcryptopb" transportpb "github.com/filecoin-project/mir/pkg/pb/transportpb" + wrappers "github.com/golang/protobuf/ptypes/wrappers" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" ) @@ -260,14 +260,14 @@ func (x *Event) GetPingPong() *pingpongpb.Event { return nil } -func (x *Event) GetTestingString() *wrapperspb.StringValue { +func (x *Event) GetTestingString() *wrappers.StringValue { if x, ok := x.GetType().(*Event_TestingString); ok { return x.TestingString } return nil } -func (x *Event) GetTestingUint() *wrapperspb.UInt64Value { +func (x *Event) GetTestingUint() *wrappers.UInt64Value { if x, ok := x.GetType().(*Event_TestingUint); ok { return x.TestingUint } @@ -374,11 +374,11 @@ type Event_PingPong struct { type Event_TestingString struct { // for unit-tests - TestingString *wrapperspb.StringValue `protobuf:"bytes,301,opt,name=testingString,proto3,oneof"` + TestingString *wrappers.StringValue `protobuf:"bytes,301,opt,name=testingString,proto3,oneof"` } type Event_TestingUint struct { - TestingUint *wrapperspb.UInt64Value `protobuf:"bytes,302,opt,name=testingUint,proto3,oneof"` + TestingUint *wrappers.UInt64Value `protobuf:"bytes,302,opt,name=testingUint,proto3,oneof"` } type Event_Tester struct { @@ -944,8 +944,8 @@ var file_eventpb_eventpb_proto_goTypes = []interface{}{ (*chkpvalidatorpb.Event)(nil), // 20: chkpvalidatorpb.Event (*pprepvalidatorpb.Event)(nil), // 21: pprepvalidatorpb.Event (*pingpongpb.Event)(nil), // 22: pingpongpb.Event - (*wrapperspb.StringValue)(nil), // 23: google.protobuf.StringValue - (*wrapperspb.UInt64Value)(nil), // 24: google.protobuf.UInt64Value + (*wrappers.StringValue)(nil), // 23: google.protobuf.StringValue + (*wrappers.UInt64Value)(nil), // 24: google.protobuf.UInt64Value (*testerpb.Tester)(nil), // 25: testerpb.Tester } var file_eventpb_eventpb_proto_depIdxs = []int32{ diff --git a/pkg/pb/factorypb/factorypb.pb.go b/pkg/pb/factorypb/factorypb.pb.go index a0bed354d..3e62d03b4 100644 --- a/pkg/pb/factorypb/factorypb.pb.go +++ b/pkg/pb/factorypb/factorypb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: factorypb/factorypb.proto package factorypb @@ -9,6 +9,7 @@ package factorypb import ( mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" + granitepb "github.com/filecoin-project/mir/pkg/pb/granitepb" _ "github.com/filecoin-project/mir/pkg/pb/mir" ordererpb "github.com/filecoin-project/mir/pkg/pb/ordererpb" pprepvalidatorpb "github.com/filecoin-project/mir/pkg/pb/ordererpb/pprepvalidatorpb" @@ -232,6 +233,7 @@ type GeneratorParams struct { // *GeneratorParams_EchoTestModule // *GeneratorParams_PbftModule // *GeneratorParams_PpvModule + // *GeneratorParams_Granite Type isGeneratorParams_Type `protobuf_oneof:"type"` } @@ -309,6 +311,13 @@ func (x *GeneratorParams) GetPpvModule() *pprepvalidatorpb.PPrepValidatorChkp { return nil } +func (x *GeneratorParams) GetGranite() *granitepb.InstanceParams { + if x, ok := x.GetType().(*GeneratorParams_Granite); ok { + return x.Granite + } + return nil +} + type isGeneratorParams_Type interface { isGeneratorParams_Type() } @@ -333,6 +342,10 @@ type GeneratorParams_PpvModule struct { PpvModule *pprepvalidatorpb.PPrepValidatorChkp `protobuf:"bytes,5,opt,name=ppv_module,json=ppvModule,proto3,oneof"` } +type GeneratorParams_Granite struct { + Granite *granitepb.InstanceParams `protobuf:"bytes,6,opt,name=granite,proto3,oneof"` +} + func (*GeneratorParams_MultisigCollector) isGeneratorParams_Type() {} func (*GeneratorParams_Checkpoint) isGeneratorParams_Type() {} @@ -343,6 +356,8 @@ func (*GeneratorParams_PbftModule) isGeneratorParams_Type() {} func (*GeneratorParams_PpvModule) isGeneratorParams_Type() {} +func (*GeneratorParams_Granite) isGeneratorParams_Type() {} + // Used only for unit tests. type EchoModuleParams struct { state protoimpl.MessageState @@ -405,75 +420,80 @@ var file_factorypb_factorypb_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2f, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, - 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, - 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x35, 0x0a, 0x0a, 0x6e, 0x65, 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, - 0x4e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x65, 0x77, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, - 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, 0x61, 0x72, 0x62, - 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x61, - 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x3a, 0x04, 0x90, 0xa6, - 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0x80, 0xa6, 0x1d, 0x01, - 0x22, 0x89, 0x02, 0x0a, 0x09, 0x4e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x53, - 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x36, 0x82, 0xa6, 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x44, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x49, 0x64, 0x12, 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, - 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, + 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, + 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x98, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x6e, 0x65, + 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x77, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x66, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x3a, 0x04, 0x90, 0xa6, 0x1d, 0x01, 0x42, 0x0c, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x89, 0x02, 0x0a, 0x09, + 0x4e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x53, 0x0a, 0x09, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0x82, 0xa6, + 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, - 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x32, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x85, 0x01, 0x0a, - 0x0e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, - 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, - 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, - 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, - 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x80, 0x03, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x55, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, - 0x69, 0x73, 0x69, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x6d, 0x73, 0x63, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x11, 0x6d, 0x75, - 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, - 0x3e, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x47, 0x0a, 0x10, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0e, 0x65, 0x63, 0x68, 0x6f, 0x54, 0x65, - 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x70, 0x62, 0x66, 0x74, - 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x42, 0x46, 0x54, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x62, 0x66, 0x74, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x70, 0x76, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x50, 0x72, 0x65, 0x70, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x68, 0x6b, 0x70, 0x48, 0x00, 0x52, 0x09, - 0x70, 0x70, 0x76, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, - 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x30, 0x0a, 0x10, 0x45, 0x63, 0x68, 0x6f, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, + 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x49, 0x44, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x6d, + 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x70, 0x62, 0x2f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x72, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x61, 0x72, 0x62, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x6d, 0x0a, 0x0f, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x61, + 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, + 0xb7, 0x03, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x55, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x5f, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, + 0x2e, 0x6d, 0x73, 0x63, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x11, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, + 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0a, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x10, 0x65, 0x63, + 0x68, 0x6f, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, + 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x48, 0x00, 0x52, 0x0e, 0x65, 0x63, 0x68, 0x6f, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x70, 0x62, 0x66, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x42, 0x46, 0x54, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x48, + 0x00, 0x52, 0x0a, 0x70, 0x62, 0x66, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x45, 0x0a, + 0x0a, 0x70, 0x70, 0x76, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x50, 0x72, 0x65, 0x70, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x43, 0x68, 0x6b, 0x70, 0x48, 0x00, 0x52, 0x09, 0x70, 0x70, 0x76, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, + 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x48, 0x00, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x3a, 0x04, 0x80, 0xa6, 0x1d, + 0x01, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x30, 0x0a, 0x10, 0x45, 0x63, 0x68, + 0x6f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, + 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -499,6 +519,7 @@ var file_factorypb_factorypb_proto_goTypes = []interface{}{ (*checkpointpb.InstanceParams)(nil), // 6: checkpointpb.InstanceParams (*ordererpb.PBFTModule)(nil), // 7: ordererpb.PBFTModule (*pprepvalidatorpb.PPrepValidatorChkp)(nil), // 8: pprepvalidatorpb.PPrepValidatorChkp + (*granitepb.InstanceParams)(nil), // 9: granitepb.InstanceParams } var file_factorypb_factorypb_proto_depIdxs = []int32{ 1, // 0: factorypb.Event.new_module:type_name -> factorypb.NewModule @@ -509,11 +530,12 @@ var file_factorypb_factorypb_proto_depIdxs = []int32{ 4, // 5: factorypb.GeneratorParams.echo_test_module:type_name -> factorypb.EchoModuleParams 7, // 6: factorypb.GeneratorParams.pbft_module:type_name -> ordererpb.PBFTModule 8, // 7: factorypb.GeneratorParams.ppv_module:type_name -> pprepvalidatorpb.PPrepValidatorChkp - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 9, // 8: factorypb.GeneratorParams.granite:type_name -> granitepb.InstanceParams + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_factorypb_factorypb_proto_init() } @@ -593,6 +615,7 @@ func file_factorypb_factorypb_proto_init() { (*GeneratorParams_EchoTestModule)(nil), (*GeneratorParams_PbftModule)(nil), (*GeneratorParams_PpvModule)(nil), + (*GeneratorParams_Granite)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/pkg/pb/factorypb/factorypb.pb.mir.go b/pkg/pb/factorypb/factorypb.pb.mir.go index e73319962..7d2257b39 100644 --- a/pkg/pb/factorypb/factorypb.pb.mir.go +++ b/pkg/pb/factorypb/factorypb.pb.mir.go @@ -20,5 +20,6 @@ func (*GeneratorParams) ReflectTypeOptions() []reflect.Type { reflect.TypeOf((*GeneratorParams_EchoTestModule)(nil)), reflect.TypeOf((*GeneratorParams_PbftModule)(nil)), reflect.TypeOf((*GeneratorParams_PpvModule)(nil)), + reflect.TypeOf((*GeneratorParams_Granite)(nil)), } } diff --git a/pkg/pb/factorypb/oneof_interfaces.mir.go b/pkg/pb/factorypb/oneof_interfaces.mir.go index 5967ac202..62ed4fde6 100644 --- a/pkg/pb/factorypb/oneof_interfaces.mir.go +++ b/pkg/pb/factorypb/oneof_interfaces.mir.go @@ -5,6 +5,7 @@ package factorypb import ( mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" + granitepb "github.com/filecoin-project/mir/pkg/pb/granitepb" ordererpb "github.com/filecoin-project/mir/pkg/pb/ordererpb" pprepvalidatorpb "github.com/filecoin-project/mir/pkg/pb/ordererpb/pprepvalidatorpb" ) @@ -50,3 +51,7 @@ func (w *GeneratorParams_PbftModule) Unwrap() *ordererpb.PBFTModule { func (w *GeneratorParams_PpvModule) Unwrap() *pprepvalidatorpb.PPrepValidatorChkp { return w.PpvModule } + +func (w *GeneratorParams_Granite) Unwrap() *granitepb.InstanceParams { + return w.Granite +} diff --git a/pkg/pb/factorypb/types/types.mir.go b/pkg/pb/factorypb/types/types.mir.go index 4c33268f9..5ce96d423 100644 --- a/pkg/pb/factorypb/types/types.mir.go +++ b/pkg/pb/factorypb/types/types.mir.go @@ -7,6 +7,7 @@ import ( types2 "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb/types" types3 "github.com/filecoin-project/mir/pkg/pb/checkpointpb/types" factorypb "github.com/filecoin-project/mir/pkg/pb/factorypb" + types6 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" types5 "github.com/filecoin-project/mir/pkg/pb/ordererpb/pprepvalidatorpb/types" types4 "github.com/filecoin-project/mir/pkg/pb/ordererpb/types" types1 "github.com/filecoin-project/mir/pkg/trantor/types" @@ -213,6 +214,8 @@ func GeneratorParams_TypeFromPb(pb factorypb.GeneratorParams_Type) GeneratorPara return &GeneratorParams_PbftModule{PbftModule: types4.PBFTModuleFromPb(pb.PbftModule)} case *factorypb.GeneratorParams_PpvModule: return &GeneratorParams_PpvModule{PpvModule: types5.PPrepValidatorChkpFromPb(pb.PpvModule)} + case *factorypb.GeneratorParams_Granite: + return &GeneratorParams_Granite{Granite: types6.InstanceParamsFromPb(pb.Granite)} } return nil } @@ -337,6 +340,30 @@ func (*GeneratorParams_PpvModule) MirReflect() mirreflect.Type { return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*factorypb.GeneratorParams_PpvModule]()} } +type GeneratorParams_Granite struct { + Granite *types6.InstanceParams +} + +func (*GeneratorParams_Granite) isGeneratorParams_Type() {} + +func (w *GeneratorParams_Granite) Unwrap() *types6.InstanceParams { + return w.Granite +} + +func (w *GeneratorParams_Granite) Pb() factorypb.GeneratorParams_Type { + if w == nil { + return nil + } + if w.Granite == nil { + return &factorypb.GeneratorParams_Granite{} + } + return &factorypb.GeneratorParams_Granite{Granite: (w.Granite).Pb()} +} + +func (*GeneratorParams_Granite) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*factorypb.GeneratorParams_Granite]()} +} + func GeneratorParamsFromPb(pb *factorypb.GeneratorParams) *GeneratorParams { if pb == nil { return nil diff --git a/pkg/pb/granitepb/dsl/messages.mir.go b/pkg/pb/granitepb/dsl/messages.mir.go new file mode 100644 index 000000000..36145ed11 --- /dev/null +++ b/pkg/pb/granitepb/dsl/messages.mir.go @@ -0,0 +1,61 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepbdsl + +import ( + dsl "github.com/filecoin-project/mir/pkg/dsl" + types3 "github.com/filecoin-project/mir/pkg/granite/types" + types "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + dsl1 "github.com/filecoin-project/mir/pkg/pb/messagepb/dsl" + types2 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" + types1 "github.com/filecoin-project/mir/pkg/types" +) + +// Module-specific dsl functions for processing net messages. + +func UponMessageReceived[W types.Message_TypeWrapper[M], M any](m dsl.Module, handler func(from types1.NodeID, msg *M) error) { + dsl1.UponMessageReceived[*types2.Message_Granite](m, func(from types1.NodeID, msg *types.Message) error { + w, ok := msg.Type.(W) + if !ok { + return nil + } + + return handler(from, w.Unwrap()) + }) +} + +func UponConvergeReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, ticket *types.Ticket, signature []uint8) error) { + UponMessageReceived[*types.Message_Converge](m, func(from types1.NodeID, msg *types.Converge) error { + return handler(from, msg.Round, msg.Data, msg.Ticket, msg.Signature) + }) +} + +func UponProposeReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, signature []uint8) error) { + UponMessageReceived[*types.Message_Propose](m, func(from types1.NodeID, msg *types.Propose) error { + return handler(from, msg.Round, msg.Data, msg.Signature) + }) +} + +func UponPrepareReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, signature []uint8) error) { + UponMessageReceived[*types.Message_Prepare](m, func(from types1.NodeID, msg *types.Prepare) error { + return handler(from, msg.Round, msg.Data, msg.Signature) + }) +} + +func UponCommitReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, signature []uint8) error) { + UponMessageReceived[*types.Message_Commit](m, func(from types1.NodeID, msg *types.Commit) error { + return handler(from, msg.Round, msg.Data, msg.Signature) + }) +} + +func UponDecisionReceived(m dsl.Module, handler func(from types1.NodeID, data []uint8, signature []uint8) error) { + UponMessageReceived[*types.Message_Decision](m, func(from types1.NodeID, msg *types.Decision) error { + return handler(from, msg.Data, msg.Signature) + }) +} + +func UponConsensusMsgReceived(m dsl.Module, handler func(from types1.NodeID, msgType types3.MsgType, round types3.RoundNr, data []uint8, ticket *types.Ticket, signature []uint8) error) { + UponMessageReceived[*types.Message_ConsensusMsg](m, func(from types1.NodeID, msg *types.ConsensusMsg) error { + return handler(from, msg.MsgType, msg.Round, msg.Data, msg.Ticket, msg.Signature) + }) +} diff --git a/pkg/pb/granitepb/granitepb.pb.go b/pkg/pb/granitepb/granitepb.pb.go new file mode 100644 index 000000000..9d49797df --- /dev/null +++ b/pkg/pb/granitepb/granitepb.pb.go @@ -0,0 +1,952 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.12.4 +// source: granitepb/granitepb.proto + +package granitepb + +import ( + _ "github.com/filecoin-project/mir/pkg/pb/mir" + _ "github.com/filecoin-project/mir/pkg/pb/net" + trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 Message struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // *Message_Converge + // *Message_Propose + // *Message_Prepare + // *Message_Commit + // *Message_Decision + // *Message_ConsensusMsg + Type isMessage_Type `protobuf_oneof:"type"` +} + +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[0] + 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 Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{0} +} + +func (m *Message) GetType() isMessage_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *Message) GetConverge() *Converge { + if x, ok := x.GetType().(*Message_Converge); ok { + return x.Converge + } + return nil +} + +func (x *Message) GetPropose() *Propose { + if x, ok := x.GetType().(*Message_Propose); ok { + return x.Propose + } + return nil +} + +func (x *Message) GetPrepare() *Prepare { + if x, ok := x.GetType().(*Message_Prepare); ok { + return x.Prepare + } + return nil +} + +func (x *Message) GetCommit() *Commit { + if x, ok := x.GetType().(*Message_Commit); ok { + return x.Commit + } + return nil +} + +func (x *Message) GetDecision() *Decision { + if x, ok := x.GetType().(*Message_Decision); ok { + return x.Decision + } + return nil +} + +func (x *Message) GetConsensusMsg() *ConsensusMsg { + if x, ok := x.GetType().(*Message_ConsensusMsg); ok { + return x.ConsensusMsg + } + return nil +} + +type isMessage_Type interface { + isMessage_Type() +} + +type Message_Converge struct { + Converge *Converge `protobuf:"bytes,1,opt,name=converge,proto3,oneof"` +} + +type Message_Propose struct { + Propose *Propose `protobuf:"bytes,2,opt,name=propose,proto3,oneof"` +} + +type Message_Prepare struct { + Prepare *Prepare `protobuf:"bytes,3,opt,name=prepare,proto3,oneof"` +} + +type Message_Commit struct { + Commit *Commit `protobuf:"bytes,4,opt,name=commit,proto3,oneof"` +} + +type Message_Decision struct { + Decision *Decision `protobuf:"bytes,5,opt,name=decision,proto3,oneof"` +} + +type Message_ConsensusMsg struct { + ConsensusMsg *ConsensusMsg `protobuf:"bytes,6,opt,name=consensus_msg,json=consensusMsg,proto3,oneof"` +} + +func (*Message_Converge) isMessage_Type() {} + +func (*Message_Propose) isMessage_Type() {} + +func (*Message_Prepare) isMessage_Type() {} + +func (*Message_Commit) isMessage_Type() {} + +func (*Message_Decision) isMessage_Type() {} + +func (*Message_ConsensusMsg) isMessage_Type() {} + +type ConsensusMsg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MsgType int32 `protobuf:"varint,1,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` + Round uint64 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Ticket *Ticket `protobuf:"bytes,4,opt,name=ticket,proto3" json:"ticket,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *ConsensusMsg) Reset() { + *x = ConsensusMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConsensusMsg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConsensusMsg) ProtoMessage() {} + +func (x *ConsensusMsg) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[1] + 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 ConsensusMsg.ProtoReflect.Descriptor instead. +func (*ConsensusMsg) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{1} +} + +func (x *ConsensusMsg) GetMsgType() int32 { + if x != nil { + return x.MsgType + } + return 0 +} + +func (x *ConsensusMsg) GetRound() uint64 { + if x != nil { + return x.Round + } + return 0 +} + +func (x *ConsensusMsg) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *ConsensusMsg) GetTicket() *Ticket { + if x != nil { + return x.Ticket + } + return nil +} + +func (x *ConsensusMsg) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type Converge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Ticket *Ticket `protobuf:"bytes,3,opt,name=ticket,proto3" json:"ticket,omitempty"` + Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Converge) Reset() { + *x = Converge{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Converge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Converge) ProtoMessage() {} + +func (x *Converge) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[2] + 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 Converge.ProtoReflect.Descriptor instead. +func (*Converge) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{2} +} + +func (x *Converge) GetRound() uint64 { + if x != nil { + return x.Round + } + return 0 +} + +func (x *Converge) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Converge) GetTicket() *Ticket { + if x != nil { + return x.Ticket + } + return nil +} + +func (x *Converge) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type Ticket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // TODO include actual ticket based on VRF proofs +} + +func (x *Ticket) Reset() { + *x = Ticket{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ticket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ticket) ProtoMessage() {} + +func (x *Ticket) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_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 Ticket.ProtoReflect.Descriptor instead. +func (*Ticket) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{3} +} + +func (x *Ticket) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type Propose struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Propose) Reset() { + *x = Propose{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Propose) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Propose) ProtoMessage() {} + +func (x *Propose) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[4] + 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 Propose.ProtoReflect.Descriptor instead. +func (*Propose) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{4} +} + +func (x *Propose) GetRound() uint64 { + if x != nil { + return x.Round + } + return 0 +} + +func (x *Propose) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Propose) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type Prepare struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Prepare) Reset() { + *x = Prepare{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Prepare) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Prepare) ProtoMessage() {} + +func (x *Prepare) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[5] + 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 Prepare.ProtoReflect.Descriptor instead. +func (*Prepare) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{5} +} + +func (x *Prepare) GetRound() uint64 { + if x != nil { + return x.Round + } + return 0 +} + +func (x *Prepare) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Prepare) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type Commit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Commit) Reset() { + *x = Commit{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Commit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Commit) ProtoMessage() {} + +func (x *Commit) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[6] + 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 Commit.ProtoReflect.Descriptor instead. +func (*Commit) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{6} +} + +func (x *Commit) GetRound() uint64 { + if x != nil { + return x.Round + } + return 0 +} + +func (x *Commit) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Commit) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type Decision struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Decision) Reset() { + *x = Decision{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Decision) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Decision) ProtoMessage() {} + +func (x *Decision) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[7] + 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 Decision.ProtoReflect.Descriptor instead. +func (*Decision) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{7} +} + +func (x *Decision) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Decision) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type InstanceParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceUid uint64 `protobuf:"varint,1,opt,name=instance_uid,json=instanceUid,proto3" json:"instance_uid,omitempty"` + Membership *trantorpb.Membership `protobuf:"bytes,2,opt,name=membership,proto3" json:"membership,omitempty"` +} + +func (x *InstanceParams) Reset() { + *x = InstanceParams{} + if protoimpl.UnsafeEnabled { + mi := &file_granitepb_granitepb_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstanceParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstanceParams) ProtoMessage() {} + +func (x *InstanceParams) ProtoReflect() protoreflect.Message { + mi := &file_granitepb_granitepb_proto_msgTypes[8] + 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 InstanceParams.ProtoReflect.Descriptor instead. +func (*InstanceParams) Descriptor() ([]byte, []int) { + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{8} +} + +func (x *InstanceParams) GetInstanceUid() uint64 { + if x != nil { + return x.InstanceUid + } + return 0 +} + +func (x *InstanceParams) GetMembership() *trantorpb.Membership { + if x != nil { + return x.Membership + } + return nil +} + +var File_granitepb_granitepb_proto protoreflect.FileDescriptor + +var file_granitepb_granitepb_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x6e, + 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x72, 0x61, + 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x1a, 0x19, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x70, + 0x62, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x02, + 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x08, 0x63, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, + 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, + 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x07, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, + 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x06, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, + 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, + 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x64, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, + 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x48, 0x00, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x48, 0x00, 0x52, 0x0c, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x3a, 0x04, 0xc8, 0xe4, + 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0xc8, 0xe4, 0x1d, 0x01, + 0x22, 0xa0, 0x02, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, + 0x67, 0x12, 0x58, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, + 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x53, 0x0a, 0x05, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, + 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, + 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, + 0xe4, 0x1d, 0x01, 0x22, 0xc2, 0x01, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, + 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x06, 0x74, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x61, 0x6e, + 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x22, 0x0a, 0x06, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x96, 0x01, 0x0a, + 0x07, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, + 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, + 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, + 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x96, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, + 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, + 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x95, + 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, + 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, + 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x42, 0x0a, 0x08, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x70, 0x0a, 0x0e, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x69, 0x64, 0x12, + 0x35, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, + 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_granitepb_granitepb_proto_rawDescOnce sync.Once + file_granitepb_granitepb_proto_rawDescData = file_granitepb_granitepb_proto_rawDesc +) + +func file_granitepb_granitepb_proto_rawDescGZIP() []byte { + file_granitepb_granitepb_proto_rawDescOnce.Do(func() { + file_granitepb_granitepb_proto_rawDescData = protoimpl.X.CompressGZIP(file_granitepb_granitepb_proto_rawDescData) + }) + return file_granitepb_granitepb_proto_rawDescData +} + +var file_granitepb_granitepb_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_granitepb_granitepb_proto_goTypes = []interface{}{ + (*Message)(nil), // 0: granitepb.Message + (*ConsensusMsg)(nil), // 1: granitepb.ConsensusMsg + (*Converge)(nil), // 2: granitepb.Converge + (*Ticket)(nil), // 3: granitepb.Ticket + (*Propose)(nil), // 4: granitepb.Propose + (*Prepare)(nil), // 5: granitepb.Prepare + (*Commit)(nil), // 6: granitepb.Commit + (*Decision)(nil), // 7: granitepb.Decision + (*InstanceParams)(nil), // 8: granitepb.InstanceParams + (*trantorpb.Membership)(nil), // 9: trantorpb.Membership +} +var file_granitepb_granitepb_proto_depIdxs = []int32{ + 2, // 0: granitepb.Message.converge:type_name -> granitepb.Converge + 4, // 1: granitepb.Message.propose:type_name -> granitepb.Propose + 5, // 2: granitepb.Message.prepare:type_name -> granitepb.Prepare + 6, // 3: granitepb.Message.commit:type_name -> granitepb.Commit + 7, // 4: granitepb.Message.decision:type_name -> granitepb.Decision + 1, // 5: granitepb.Message.consensus_msg:type_name -> granitepb.ConsensusMsg + 3, // 6: granitepb.ConsensusMsg.ticket:type_name -> granitepb.Ticket + 3, // 7: granitepb.Converge.ticket:type_name -> granitepb.Ticket + 9, // 8: granitepb.InstanceParams.membership:type_name -> trantorpb.Membership + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_granitepb_granitepb_proto_init() } +func file_granitepb_granitepb_proto_init() { + if File_granitepb_granitepb_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_granitepb_granitepb_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConsensusMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Converge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ticket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Propose); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Prepare); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Commit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Decision); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_granitepb_granitepb_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstanceParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_granitepb_granitepb_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Message_Converge)(nil), + (*Message_Propose)(nil), + (*Message_Prepare)(nil), + (*Message_Commit)(nil), + (*Message_Decision)(nil), + (*Message_ConsensusMsg)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_granitepb_granitepb_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_granitepb_granitepb_proto_goTypes, + DependencyIndexes: file_granitepb_granitepb_proto_depIdxs, + MessageInfos: file_granitepb_granitepb_proto_msgTypes, + }.Build() + File_granitepb_granitepb_proto = out.File + file_granitepb_granitepb_proto_rawDesc = nil + file_granitepb_granitepb_proto_goTypes = nil + file_granitepb_granitepb_proto_depIdxs = nil +} diff --git a/pkg/pb/granitepb/granitepb.pb.mir.go b/pkg/pb/granitepb/granitepb.pb.mir.go new file mode 100644 index 000000000..1ed60e239 --- /dev/null +++ b/pkg/pb/granitepb/granitepb.pb.mir.go @@ -0,0 +1,18 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepb + +import ( + reflect "reflect" +) + +func (*Message) ReflectTypeOptions() []reflect.Type { + return []reflect.Type{ + reflect.TypeOf((*Message_Converge)(nil)), + reflect.TypeOf((*Message_Propose)(nil)), + reflect.TypeOf((*Message_Prepare)(nil)), + reflect.TypeOf((*Message_Commit)(nil)), + reflect.TypeOf((*Message_Decision)(nil)), + reflect.TypeOf((*Message_ConsensusMsg)(nil)), + } +} diff --git a/pkg/pb/granitepb/msgs/msgs.mir.go b/pkg/pb/granitepb/msgs/msgs.mir.go new file mode 100644 index 000000000..0c63f868f --- /dev/null +++ b/pkg/pb/granitepb/msgs/msgs.mir.go @@ -0,0 +1,114 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepbmsgs + +import ( + types1 "github.com/filecoin-project/mir/pkg/granite/types" + types2 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + types3 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" + types "github.com/filecoin-project/mir/pkg/types" +) + +func Converge(destModule types.ModuleID, round types1.RoundNr, data []uint8, ticket *types2.Ticket, signature []uint8) *types3.Message { + return &types3.Message{ + DestModule: destModule, + Type: &types3.Message_Granite{ + Granite: &types2.Message{ + Type: &types2.Message_Converge{ + Converge: &types2.Converge{ + Round: round, + Data: data, + Ticket: ticket, + Signature: signature, + }, + }, + }, + }, + } +} + +func Propose(destModule types.ModuleID, round types1.RoundNr, data []uint8, signature []uint8) *types3.Message { + return &types3.Message{ + DestModule: destModule, + Type: &types3.Message_Granite{ + Granite: &types2.Message{ + Type: &types2.Message_Propose{ + Propose: &types2.Propose{ + Round: round, + Data: data, + Signature: signature, + }, + }, + }, + }, + } +} + +func Prepare(destModule types.ModuleID, round types1.RoundNr, data []uint8, signature []uint8) *types3.Message { + return &types3.Message{ + DestModule: destModule, + Type: &types3.Message_Granite{ + Granite: &types2.Message{ + Type: &types2.Message_Prepare{ + Prepare: &types2.Prepare{ + Round: round, + Data: data, + Signature: signature, + }, + }, + }, + }, + } +} + +func Commit(destModule types.ModuleID, round types1.RoundNr, data []uint8, signature []uint8) *types3.Message { + return &types3.Message{ + DestModule: destModule, + Type: &types3.Message_Granite{ + Granite: &types2.Message{ + Type: &types2.Message_Commit{ + Commit: &types2.Commit{ + Round: round, + Data: data, + Signature: signature, + }, + }, + }, + }, + } +} + +func Decision(destModule types.ModuleID, data []uint8, signature []uint8) *types3.Message { + return &types3.Message{ + DestModule: destModule, + Type: &types3.Message_Granite{ + Granite: &types2.Message{ + Type: &types2.Message_Decision{ + Decision: &types2.Decision{ + Data: data, + Signature: signature, + }, + }, + }, + }, + } +} + +func ConsensusMsg(destModule types.ModuleID, msgType types1.MsgType, round types1.RoundNr, data []uint8, ticket *types2.Ticket, signature []uint8) *types3.Message { + return &types3.Message{ + DestModule: destModule, + Type: &types3.Message_Granite{ + Granite: &types2.Message{ + Type: &types2.Message_ConsensusMsg{ + ConsensusMsg: &types2.ConsensusMsg{ + MsgType: msgType, + Round: round, + Data: data, + Ticket: ticket, + Signature: signature, + }, + }, + }, + }, + } +} diff --git a/pkg/pb/granitepb/oneof_interfaces.mir.go b/pkg/pb/granitepb/oneof_interfaces.mir.go new file mode 100644 index 000000000..62ae7ffbe --- /dev/null +++ b/pkg/pb/granitepb/oneof_interfaces.mir.go @@ -0,0 +1,34 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepb + +type Message_Type = isMessage_Type + +type Message_TypeWrapper[T any] interface { + Message_Type + Unwrap() *T +} + +func (w *Message_Converge) Unwrap() *Converge { + return w.Converge +} + +func (w *Message_Propose) Unwrap() *Propose { + return w.Propose +} + +func (w *Message_Prepare) Unwrap() *Prepare { + return w.Prepare +} + +func (w *Message_Commit) Unwrap() *Commit { + return w.Commit +} + +func (w *Message_Decision) Unwrap() *Decision { + return w.Decision +} + +func (w *Message_ConsensusMsg) Unwrap() *ConsensusMsg { + return w.ConsensusMsg +} diff --git a/pkg/pb/granitepb/types/types.mir.go b/pkg/pb/granitepb/types/types.mir.go new file mode 100644 index 000000000..fc5e6a434 --- /dev/null +++ b/pkg/pb/granitepb/types/types.mir.go @@ -0,0 +1,501 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepbtypes + +import ( + mirreflect "github.com/filecoin-project/mir/codegen/mirreflect" + types "github.com/filecoin-project/mir/pkg/granite/types" + granitepb "github.com/filecoin-project/mir/pkg/pb/granitepb" + types1 "github.com/filecoin-project/mir/pkg/pb/trantorpb/types" + reflectutil "github.com/filecoin-project/mir/pkg/util/reflectutil" +) + +type Message struct { + Type Message_Type +} + +type Message_Type interface { + mirreflect.GeneratedType + isMessage_Type() + Pb() granitepb.Message_Type +} + +type Message_TypeWrapper[T any] interface { + Message_Type + Unwrap() *T +} + +func Message_TypeFromPb(pb granitepb.Message_Type) Message_Type { + if pb == nil { + return nil + } + switch pb := pb.(type) { + case *granitepb.Message_Converge: + return &Message_Converge{Converge: ConvergeFromPb(pb.Converge)} + case *granitepb.Message_Propose: + return &Message_Propose{Propose: ProposeFromPb(pb.Propose)} + case *granitepb.Message_Prepare: + return &Message_Prepare{Prepare: PrepareFromPb(pb.Prepare)} + case *granitepb.Message_Commit: + return &Message_Commit{Commit: CommitFromPb(pb.Commit)} + case *granitepb.Message_Decision: + return &Message_Decision{Decision: DecisionFromPb(pb.Decision)} + case *granitepb.Message_ConsensusMsg: + return &Message_ConsensusMsg{ConsensusMsg: ConsensusMsgFromPb(pb.ConsensusMsg)} + } + return nil +} + +type Message_Converge struct { + Converge *Converge +} + +func (*Message_Converge) isMessage_Type() {} + +func (w *Message_Converge) Unwrap() *Converge { + return w.Converge +} + +func (w *Message_Converge) Pb() granitepb.Message_Type { + if w == nil { + return nil + } + if w.Converge == nil { + return &granitepb.Message_Converge{} + } + return &granitepb.Message_Converge{Converge: (w.Converge).Pb()} +} + +func (*Message_Converge) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Converge]()} +} + +type Message_Propose struct { + Propose *Propose +} + +func (*Message_Propose) isMessage_Type() {} + +func (w *Message_Propose) Unwrap() *Propose { + return w.Propose +} + +func (w *Message_Propose) Pb() granitepb.Message_Type { + if w == nil { + return nil + } + if w.Propose == nil { + return &granitepb.Message_Propose{} + } + return &granitepb.Message_Propose{Propose: (w.Propose).Pb()} +} + +func (*Message_Propose) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Propose]()} +} + +type Message_Prepare struct { + Prepare *Prepare +} + +func (*Message_Prepare) isMessage_Type() {} + +func (w *Message_Prepare) Unwrap() *Prepare { + return w.Prepare +} + +func (w *Message_Prepare) Pb() granitepb.Message_Type { + if w == nil { + return nil + } + if w.Prepare == nil { + return &granitepb.Message_Prepare{} + } + return &granitepb.Message_Prepare{Prepare: (w.Prepare).Pb()} +} + +func (*Message_Prepare) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Prepare]()} +} + +type Message_Commit struct { + Commit *Commit +} + +func (*Message_Commit) isMessage_Type() {} + +func (w *Message_Commit) Unwrap() *Commit { + return w.Commit +} + +func (w *Message_Commit) Pb() granitepb.Message_Type { + if w == nil { + return nil + } + if w.Commit == nil { + return &granitepb.Message_Commit{} + } + return &granitepb.Message_Commit{Commit: (w.Commit).Pb()} +} + +func (*Message_Commit) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Commit]()} +} + +type Message_Decision struct { + Decision *Decision +} + +func (*Message_Decision) isMessage_Type() {} + +func (w *Message_Decision) Unwrap() *Decision { + return w.Decision +} + +func (w *Message_Decision) Pb() granitepb.Message_Type { + if w == nil { + return nil + } + if w.Decision == nil { + return &granitepb.Message_Decision{} + } + return &granitepb.Message_Decision{Decision: (w.Decision).Pb()} +} + +func (*Message_Decision) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Decision]()} +} + +type Message_ConsensusMsg struct { + ConsensusMsg *ConsensusMsg +} + +func (*Message_ConsensusMsg) isMessage_Type() {} + +func (w *Message_ConsensusMsg) Unwrap() *ConsensusMsg { + return w.ConsensusMsg +} + +func (w *Message_ConsensusMsg) Pb() granitepb.Message_Type { + if w == nil { + return nil + } + if w.ConsensusMsg == nil { + return &granitepb.Message_ConsensusMsg{} + } + return &granitepb.Message_ConsensusMsg{ConsensusMsg: (w.ConsensusMsg).Pb()} +} + +func (*Message_ConsensusMsg) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_ConsensusMsg]()} +} + +func MessageFromPb(pb *granitepb.Message) *Message { + if pb == nil { + return nil + } + return &Message{ + Type: Message_TypeFromPb(pb.Type), + } +} + +func (m *Message) Pb() *granitepb.Message { + if m == nil { + return nil + } + pbMessage := &granitepb.Message{} + { + if m.Type != nil { + pbMessage.Type = (m.Type).Pb() + } + } + + return pbMessage +} + +func (*Message) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message]()} +} + +type ConsensusMsg struct { + MsgType types.MsgType + Round types.RoundNr + Data []uint8 + Ticket *Ticket + Signature []uint8 +} + +func ConsensusMsgFromPb(pb *granitepb.ConsensusMsg) *ConsensusMsg { + if pb == nil { + return nil + } + return &ConsensusMsg{ + MsgType: (types.MsgType)(pb.MsgType), + Round: (types.RoundNr)(pb.Round), + Data: pb.Data, + Ticket: TicketFromPb(pb.Ticket), + Signature: pb.Signature, + } +} + +func (m *ConsensusMsg) Pb() *granitepb.ConsensusMsg { + if m == nil { + return nil + } + pbMessage := &granitepb.ConsensusMsg{} + { + pbMessage.MsgType = (int32)(m.MsgType) + pbMessage.Round = (uint64)(m.Round) + pbMessage.Data = m.Data + if m.Ticket != nil { + pbMessage.Ticket = (m.Ticket).Pb() + } + pbMessage.Signature = m.Signature + } + + return pbMessage +} + +func (*ConsensusMsg) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.ConsensusMsg]()} +} + +type Converge struct { + Round types.RoundNr + Data []uint8 + Ticket *Ticket + Signature []uint8 +} + +func ConvergeFromPb(pb *granitepb.Converge) *Converge { + if pb == nil { + return nil + } + return &Converge{ + Round: (types.RoundNr)(pb.Round), + Data: pb.Data, + Ticket: TicketFromPb(pb.Ticket), + Signature: pb.Signature, + } +} + +func (m *Converge) Pb() *granitepb.Converge { + if m == nil { + return nil + } + pbMessage := &granitepb.Converge{} + { + pbMessage.Round = (uint64)(m.Round) + pbMessage.Data = m.Data + if m.Ticket != nil { + pbMessage.Ticket = (m.Ticket).Pb() + } + pbMessage.Signature = m.Signature + } + + return pbMessage +} + +func (*Converge) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Converge]()} +} + +type Ticket struct { + Data []uint8 +} + +func TicketFromPb(pb *granitepb.Ticket) *Ticket { + if pb == nil { + return nil + } + return &Ticket{ + Data: pb.Data, + } +} + +func (m *Ticket) Pb() *granitepb.Ticket { + if m == nil { + return nil + } + pbMessage := &granitepb.Ticket{} + { + pbMessage.Data = m.Data + } + + return pbMessage +} + +func (*Ticket) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Ticket]()} +} + +type Propose struct { + Round types.RoundNr + Data []uint8 + Signature []uint8 +} + +func ProposeFromPb(pb *granitepb.Propose) *Propose { + if pb == nil { + return nil + } + return &Propose{ + Round: (types.RoundNr)(pb.Round), + Data: pb.Data, + Signature: pb.Signature, + } +} + +func (m *Propose) Pb() *granitepb.Propose { + if m == nil { + return nil + } + pbMessage := &granitepb.Propose{} + { + pbMessage.Round = (uint64)(m.Round) + pbMessage.Data = m.Data + pbMessage.Signature = m.Signature + } + + return pbMessage +} + +func (*Propose) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Propose]()} +} + +type Prepare struct { + Round types.RoundNr + Data []uint8 + Signature []uint8 +} + +func PrepareFromPb(pb *granitepb.Prepare) *Prepare { + if pb == nil { + return nil + } + return &Prepare{ + Round: (types.RoundNr)(pb.Round), + Data: pb.Data, + Signature: pb.Signature, + } +} + +func (m *Prepare) Pb() *granitepb.Prepare { + if m == nil { + return nil + } + pbMessage := &granitepb.Prepare{} + { + pbMessage.Round = (uint64)(m.Round) + pbMessage.Data = m.Data + pbMessage.Signature = m.Signature + } + + return pbMessage +} + +func (*Prepare) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Prepare]()} +} + +type Commit struct { + Round types.RoundNr + Data []uint8 + Signature []uint8 +} + +func CommitFromPb(pb *granitepb.Commit) *Commit { + if pb == nil { + return nil + } + return &Commit{ + Round: (types.RoundNr)(pb.Round), + Data: pb.Data, + Signature: pb.Signature, + } +} + +func (m *Commit) Pb() *granitepb.Commit { + if m == nil { + return nil + } + pbMessage := &granitepb.Commit{} + { + pbMessage.Round = (uint64)(m.Round) + pbMessage.Data = m.Data + pbMessage.Signature = m.Signature + } + + return pbMessage +} + +func (*Commit) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Commit]()} +} + +type Decision struct { + Data []uint8 + Signature []uint8 +} + +func DecisionFromPb(pb *granitepb.Decision) *Decision { + if pb == nil { + return nil + } + return &Decision{ + Data: pb.Data, + Signature: pb.Signature, + } +} + +func (m *Decision) Pb() *granitepb.Decision { + if m == nil { + return nil + } + pbMessage := &granitepb.Decision{} + { + pbMessage.Data = m.Data + pbMessage.Signature = m.Signature + } + + return pbMessage +} + +func (*Decision) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Decision]()} +} + +type InstanceParams struct { + InstanceUid uint64 + Membership *types1.Membership +} + +func InstanceParamsFromPb(pb *granitepb.InstanceParams) *InstanceParams { + if pb == nil { + return nil + } + return &InstanceParams{ + InstanceUid: pb.InstanceUid, + Membership: types1.MembershipFromPb(pb.Membership), + } +} + +func (m *InstanceParams) Pb() *granitepb.InstanceParams { + if m == nil { + return nil + } + pbMessage := &granitepb.InstanceParams{} + { + pbMessage.InstanceUid = m.InstanceUid + if m.Membership != nil { + pbMessage.Membership = (m.Membership).Pb() + } + } + + return pbMessage +} + +func (*InstanceParams) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.InstanceParams]()} +} diff --git a/pkg/pb/hasherpb/hasherpb.pb.go b/pkg/pb/hasherpb/hasherpb.pb.go index cdc0413ee..e3e45fada 100644 --- a/pkg/pb/hasherpb/hasherpb.pb.go +++ b/pkg/pb/hasherpb/hasherpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: hasherpb/hasherpb.proto package hasherpb diff --git a/pkg/pb/isspb/isspb.pb.go b/pkg/pb/isspb/isspb.pb.go index 825142a0a..e134e4180 100644 --- a/pkg/pb/isspb/isspb.pb.go +++ b/pkg/pb/isspb/isspb.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: isspb/isspb.proto package isspb diff --git a/pkg/pb/mempoolpb/mempoolpb.pb.go b/pkg/pb/mempoolpb/mempoolpb.pb.go index 2bfc92bc6..175bd9722 100644 --- a/pkg/pb/mempoolpb/mempoolpb.pb.go +++ b/pkg/pb/mempoolpb/mempoolpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: mempoolpb/mempoolpb.proto package mempoolpb diff --git a/pkg/pb/messagepb/messagepb.pb.go b/pkg/pb/messagepb/messagepb.pb.go index f642796cf..a527efa4d 100644 --- a/pkg/pb/messagepb/messagepb.pb.go +++ b/pkg/pb/messagepb/messagepb.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: messagepb/messagepb.proto package messagepb @@ -15,6 +15,7 @@ import ( mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" bcbpb "github.com/filecoin-project/mir/pkg/pb/bcbpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" + granitepb "github.com/filecoin-project/mir/pkg/pb/granitepb" isspb "github.com/filecoin-project/mir/pkg/pb/isspb" _ "github.com/filecoin-project/mir/pkg/pb/mir" _ "github.com/filecoin-project/mir/pkg/pb/net" @@ -46,6 +47,7 @@ type Message struct { // *Message_Pingpong // *Message_Checkpoint // *Message_Orderer + // *Message_Granite Type isMessage_Type `protobuf_oneof:"type"` } @@ -137,6 +139,13 @@ func (x *Message) GetOrderer() *ordererpb.Message { return nil } +func (x *Message) GetGranite() *granitepb.Message { + if x, ok := x.GetType().(*Message_Granite); ok { + return x.Granite + } + return nil +} + type isMessage_Type interface { isMessage_Type() } @@ -165,6 +174,10 @@ type Message_Orderer struct { Orderer *ordererpb.Message `protobuf:"bytes,7,opt,name=orderer,proto3,oneof"` } +type Message_Granite struct { + Granite *granitepb.Message `protobuf:"bytes,8,opt,name=granite,proto3,oneof"` +} + func (*Message_Iss) isMessage_Type() {} func (*Message_Bcb) isMessage_Type() {} @@ -177,6 +190,8 @@ func (*Message_Checkpoint) isMessage_Type() {} func (*Message_Orderer) isMessage_Type() {} +func (*Message_Granite) isMessage_Type() {} + var File_messagepb_messagepb_proto protoreflect.FileDescriptor var file_messagepb_messagepb_proto_rawDesc = []byte{ @@ -192,41 +207,46 @@ var file_messagepb_messagepb_proto_rawDesc = []byte{ 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, - 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, - 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, - 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x03, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x57, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0x82, 0xa6, 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x44, 0x52, 0x0a, 0x64, 0x65, - 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x03, 0x69, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x69, 0x73, 0x73, 0x70, 0x62, 0x2e, 0x49, 0x53, - 0x53, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, 0x69, 0x73, 0x73, 0x12, - 0x22, 0x0a, 0x03, 0x62, 0x63, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, - 0x63, 0x62, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, - 0x62, 0x63, 0x62, 0x12, 0x4e, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x5f, - 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, - 0x2e, 0x6d, 0x73, 0x63, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, - 0x52, 0x11, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, - 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x70, 0x69, - 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x37, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x2e, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3a, - 0x04, 0xc0, 0xe4, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0xc8, - 0xe4, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, + 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, + 0x03, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x57, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x36, 0x82, 0xa6, 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x44, 0x52, 0x0a, 0x64, 0x65, 0x73, 0x74, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x03, 0x69, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x69, 0x73, 0x73, 0x70, 0x62, 0x2e, 0x49, 0x53, 0x53, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, 0x69, 0x73, 0x73, 0x12, 0x22, 0x0a, 0x03, 0x62, 0x63, + 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x63, 0x62, 0x70, 0x62, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, 0x62, 0x63, 0x62, 0x12, 0x4e, + 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x6d, 0x73, 0x63, 0x70, + 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x11, 0x6d, 0x75, 0x6c, + 0x74, 0x69, 0x73, 0x69, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x31, + 0x0a, 0x08, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x70, 0x62, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, + 0x67, 0x12, 0x37, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0a, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, + 0x00, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x07, 0x67, 0x72, + 0x61, 0x6e, 0x69, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, + 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, + 0x00, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x3a, 0x04, 0xc0, 0xe4, 0x1d, 0x01, + 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0xc8, 0xe4, 0x1d, 0x01, 0x42, 0x32, + 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, + 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, + 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -250,6 +270,7 @@ var file_messagepb_messagepb_proto_goTypes = []interface{}{ (*pingpongpb.Message)(nil), // 4: pingpongpb.Message (*checkpointpb.Message)(nil), // 5: checkpointpb.Message (*ordererpb.Message)(nil), // 6: ordererpb.Message + (*granitepb.Message)(nil), // 7: granitepb.Message } var file_messagepb_messagepb_proto_depIdxs = []int32{ 1, // 0: messagepb.Message.iss:type_name -> isspb.ISSMessage @@ -258,11 +279,12 @@ var file_messagepb_messagepb_proto_depIdxs = []int32{ 4, // 3: messagepb.Message.pingpong:type_name -> pingpongpb.Message 5, // 4: messagepb.Message.checkpoint:type_name -> checkpointpb.Message 6, // 5: messagepb.Message.orderer:type_name -> ordererpb.Message - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 7, // 6: messagepb.Message.granite:type_name -> granitepb.Message + 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_messagepb_messagepb_proto_init() } @@ -291,6 +313,7 @@ func file_messagepb_messagepb_proto_init() { (*Message_Pingpong)(nil), (*Message_Checkpoint)(nil), (*Message_Orderer)(nil), + (*Message_Granite)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/pkg/pb/messagepb/messagepb.pb.mir.go b/pkg/pb/messagepb/messagepb.pb.mir.go index 4a44aaad3..efe767ba5 100644 --- a/pkg/pb/messagepb/messagepb.pb.mir.go +++ b/pkg/pb/messagepb/messagepb.pb.mir.go @@ -14,5 +14,6 @@ func (*Message) ReflectTypeOptions() []reflect.Type { reflect.TypeOf((*Message_Pingpong)(nil)), reflect.TypeOf((*Message_Checkpoint)(nil)), reflect.TypeOf((*Message_Orderer)(nil)), + reflect.TypeOf((*Message_Granite)(nil)), } } diff --git a/pkg/pb/messagepb/oneof_interfaces.mir.go b/pkg/pb/messagepb/oneof_interfaces.mir.go index 9cd5cdcd6..ae38eb629 100644 --- a/pkg/pb/messagepb/oneof_interfaces.mir.go +++ b/pkg/pb/messagepb/oneof_interfaces.mir.go @@ -6,6 +6,7 @@ import ( mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" bcbpb "github.com/filecoin-project/mir/pkg/pb/bcbpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" + granitepb "github.com/filecoin-project/mir/pkg/pb/granitepb" isspb "github.com/filecoin-project/mir/pkg/pb/isspb" ordererpb "github.com/filecoin-project/mir/pkg/pb/ordererpb" pingpongpb "github.com/filecoin-project/mir/pkg/pb/pingpongpb" @@ -41,3 +42,7 @@ func (w *Message_Checkpoint) Unwrap() *checkpointpb.Message { func (w *Message_Orderer) Unwrap() *ordererpb.Message { return w.Orderer } + +func (w *Message_Granite) Unwrap() *granitepb.Message { + return w.Granite +} diff --git a/pkg/pb/messagepb/types/types.mir.go b/pkg/pb/messagepb/types/types.mir.go index 3d55bc14b..f9117b47f 100644 --- a/pkg/pb/messagepb/types/types.mir.go +++ b/pkg/pb/messagepb/types/types.mir.go @@ -7,6 +7,7 @@ import ( types3 "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb/types" types2 "github.com/filecoin-project/mir/pkg/pb/bcbpb/types" types5 "github.com/filecoin-project/mir/pkg/pb/checkpointpb/types" + types7 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" types1 "github.com/filecoin-project/mir/pkg/pb/isspb/types" messagepb "github.com/filecoin-project/mir/pkg/pb/messagepb" types6 "github.com/filecoin-project/mir/pkg/pb/ordererpb/types" @@ -48,6 +49,8 @@ func Message_TypeFromPb(pb messagepb.Message_Type) Message_Type { return &Message_Checkpoint{Checkpoint: types5.MessageFromPb(pb.Checkpoint)} case *messagepb.Message_Orderer: return &Message_Orderer{Orderer: types6.MessageFromPb(pb.Orderer)} + case *messagepb.Message_Granite: + return &Message_Granite{Granite: types7.MessageFromPb(pb.Granite)} } return nil } @@ -196,6 +199,30 @@ func (*Message_Orderer) MirReflect() mirreflect.Type { return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*messagepb.Message_Orderer]()} } +type Message_Granite struct { + Granite *types7.Message +} + +func (*Message_Granite) isMessage_Type() {} + +func (w *Message_Granite) Unwrap() *types7.Message { + return w.Granite +} + +func (w *Message_Granite) Pb() messagepb.Message_Type { + if w == nil { + return nil + } + if w.Granite == nil { + return &messagepb.Message_Granite{} + } + return &messagepb.Message_Granite{Granite: (w.Granite).Pb()} +} + +func (*Message_Granite) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*messagepb.Message_Granite]()} +} + func MessageFromPb(pb *messagepb.Message) *Message { if pb == nil { return nil diff --git a/pkg/pb/mir/codegen_extensions.pb.go b/pkg/pb/mir/codegen_extensions.pb.go index 7e20985ec..f251ed1d4 100644 --- a/pkg/pb/mir/codegen_extensions.pb.go +++ b/pkg/pb/mir/codegen_extensions.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: mir/codegen_extensions.proto package mir import ( + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" reflect "reflect" ) @@ -22,7 +22,7 @@ const ( var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60000, Name: "mir.struct", @@ -30,7 +30,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60001, Name: "mir.event_root", @@ -38,7 +38,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60002, Name: "mir.event_class", @@ -46,7 +46,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60003, Name: "mir.event", @@ -54,7 +54,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.OneofOptions)(nil), + ExtendedType: (*descriptor.OneofOptions)(nil), ExtensionType: (*bool)(nil), Field: 60000, Name: "mir.event_type", @@ -62,7 +62,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 60000, Name: "mir.type", @@ -70,7 +70,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 60002, Name: "mir.omit_in_event_constructors", @@ -78,7 +78,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 60003, Name: "mir.origin_request", @@ -86,7 +86,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 60004, Name: "mir.origin_response", @@ -94,7 +94,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 60005, Name: "mir.key_type", @@ -102,7 +102,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 60006, Name: "mir.value_type", @@ -111,7 +111,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptorpb.MessageOptions. +// Extension fields to descriptor.MessageOptions. var ( // optional bool struct = 60000; E_Struct = &file_mir_codegen_extensions_proto_extTypes[0] @@ -123,13 +123,13 @@ var ( E_Event = &file_mir_codegen_extensions_proto_extTypes[3] ) -// Extension fields to descriptorpb.OneofOptions. +// Extension fields to descriptor.OneofOptions. var ( // optional bool event_type = 60000; E_EventType = &file_mir_codegen_extensions_proto_extTypes[4] ) -// Extension fields to descriptorpb.FieldOptions. +// Extension fields to descriptor.FieldOptions. var ( // optional string type = 60000; E_Type = &file_mir_codegen_extensions_proto_extTypes[5] @@ -205,9 +205,9 @@ var file_mir_codegen_extensions_proto_rawDesc = []byte{ } var file_mir_codegen_extensions_proto_goTypes = []interface{}{ - (*descriptorpb.MessageOptions)(nil), // 0: google.protobuf.MessageOptions - (*descriptorpb.OneofOptions)(nil), // 1: google.protobuf.OneofOptions - (*descriptorpb.FieldOptions)(nil), // 2: google.protobuf.FieldOptions + (*descriptor.MessageOptions)(nil), // 0: google.protobuf.MessageOptions + (*descriptor.OneofOptions)(nil), // 1: google.protobuf.OneofOptions + (*descriptor.FieldOptions)(nil), // 2: google.protobuf.FieldOptions } var file_mir_codegen_extensions_proto_depIdxs = []int32{ 0, // 0: mir.struct:extendee -> google.protobuf.MessageOptions diff --git a/pkg/pb/net/codegen_extensions.pb.go b/pkg/pb/net/codegen_extensions.pb.go index 8175c8679..2664c3c27 100644 --- a/pkg/pb/net/codegen_extensions.pb.go +++ b/pkg/pb/net/codegen_extensions.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: net/codegen_extensions.proto package net import ( + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" reflect "reflect" ) @@ -22,7 +22,7 @@ const ( var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 61000, Name: "net.message_root", @@ -30,7 +30,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "net/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 61001, Name: "net.message_class", @@ -38,7 +38,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "net/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 61002, Name: "net.message", @@ -46,7 +46,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "net/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.OneofOptions)(nil), + ExtendedType: (*descriptor.OneofOptions)(nil), ExtensionType: (*bool)(nil), Field: 61001, Name: "net.message_type", @@ -55,7 +55,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptorpb.MessageOptions. +// Extension fields to descriptor.MessageOptions. var ( // optional bool message_root = 61000; E_MessageRoot = &file_net_codegen_extensions_proto_extTypes[0] @@ -65,7 +65,7 @@ var ( E_Message = &file_net_codegen_extensions_proto_extTypes[2] ) -// Extension fields to descriptorpb.OneofOptions. +// Extension fields to descriptor.OneofOptions. var ( // optional bool message_type = 61001; E_MessageType = &file_net_codegen_extensions_proto_extTypes[3] @@ -102,8 +102,8 @@ var file_net_codegen_extensions_proto_rawDesc = []byte{ } var file_net_codegen_extensions_proto_goTypes = []interface{}{ - (*descriptorpb.MessageOptions)(nil), // 0: google.protobuf.MessageOptions - (*descriptorpb.OneofOptions)(nil), // 1: google.protobuf.OneofOptions + (*descriptor.MessageOptions)(nil), // 0: google.protobuf.MessageOptions + (*descriptor.OneofOptions)(nil), // 1: google.protobuf.OneofOptions } var file_net_codegen_extensions_proto_depIdxs = []int32{ 0, // 0: net.message_root:extendee -> google.protobuf.MessageOptions diff --git a/pkg/pb/ordererpb/ordererpb.pb.go b/pkg/pb/ordererpb/ordererpb.pb.go index 6be8f8e28..c7dcba5cd 100644 --- a/pkg/pb/ordererpb/ordererpb.pb.go +++ b/pkg/pb/ordererpb/ordererpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: ordererpb/ordererpb.proto package ordererpb diff --git a/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go b/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go index 40f6d4855..e84c1442c 100644 --- a/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go +++ b/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: ordererpb/pprepvalidatorpb/pprepvalidatorpb.proto package pprepvalidatorpb diff --git a/pkg/pb/pbftpb/pbftpb.pb.go b/pkg/pb/pbftpb/pbftpb.pb.go index 62b472a49..1eef4f3ac 100644 --- a/pkg/pb/pbftpb/pbftpb.pb.go +++ b/pkg/pb/pbftpb/pbftpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: pbftpb/pbftpb.proto package pbftpb diff --git a/pkg/pb/pingpongpb/pingpongpb.pb.go b/pkg/pb/pingpongpb/pingpongpb.pb.go index 2f88aec7c..75f77c579 100644 --- a/pkg/pb/pingpongpb/pingpongpb.pb.go +++ b/pkg/pb/pingpongpb/pingpongpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: pingpongpb/pingpongpb.proto package pingpongpb diff --git a/pkg/pb/recordingpb/recordingpb.pb.go b/pkg/pb/recordingpb/recordingpb.pb.go index 2585b98fa..c528445c3 100644 --- a/pkg/pb/recordingpb/recordingpb.pb.go +++ b/pkg/pb/recordingpb/recordingpb.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: recordingpb/recordingpb.proto package recordingpb diff --git a/pkg/pb/testerpb/testerpb.pb.go b/pkg/pb/testerpb/testerpb.pb.go index 7dedd89c7..c7635844e 100644 --- a/pkg/pb/testerpb/testerpb.pb.go +++ b/pkg/pb/testerpb/testerpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: testerpb/testerpb.proto package testerpb diff --git a/pkg/pb/threshcryptopb/threshcryptopb.pb.go b/pkg/pb/threshcryptopb/threshcryptopb.pb.go index 739438330..d1ae43923 100644 --- a/pkg/pb/threshcryptopb/threshcryptopb.pb.go +++ b/pkg/pb/threshcryptopb/threshcryptopb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: threshcryptopb/threshcryptopb.proto package threshcryptopb diff --git a/pkg/pb/transportpb/transportpb.pb.go b/pkg/pb/transportpb/transportpb.pb.go index ef42d1f2b..15babbc11 100644 --- a/pkg/pb/transportpb/transportpb.pb.go +++ b/pkg/pb/transportpb/transportpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: transportpb/transportpb.proto package transportpb diff --git a/pkg/pb/trantorpb/trantorpb.pb.go b/pkg/pb/trantorpb/trantorpb.pb.go index ad414366b..72c10d176 100644 --- a/pkg/pb/trantorpb/trantorpb.pb.go +++ b/pkg/pb/trantorpb/trantorpb.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: trantorpb/trantorpb.proto package trantorpb diff --git a/pkg/transactionreceiver/transactionreceiver.pb.go b/pkg/transactionreceiver/transactionreceiver.pb.go index c67b5b369..8df789148 100644 --- a/pkg/transactionreceiver/transactionreceiver.pb.go +++ b/pkg/transactionreceiver/transactionreceiver.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: transactionreceiver/transactionreceiver.proto package transactionreceiver diff --git a/pkg/transactionreceiver/transactionreceiver_grpc.pb.go b/pkg/transactionreceiver/transactionreceiver_grpc.pb.go index c088751b1..f75745de8 100644 --- a/pkg/transactionreceiver/transactionreceiver_grpc.pb.go +++ b/pkg/transactionreceiver/transactionreceiver_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: transactionreceiver/transactionreceiver.proto package transactionreceiver diff --git a/protos/factorypb/factorypb.proto b/protos/factorypb/factorypb.proto index a3a080a8b..5a570ad16 100644 --- a/protos/factorypb/factorypb.proto +++ b/protos/factorypb/factorypb.proto @@ -8,7 +8,7 @@ import "availabilitypb/mscpb/mscpb.proto"; import "checkpointpb/checkpointpb.proto"; import "ordererpb/ordererpb.proto"; import "ordererpb/pprepvalidatorpb/pprepvalidatorpb.proto"; - +import "granitepb/granitepb.proto"; import "mir/codegen_extensions.proto"; @@ -52,6 +52,7 @@ message GeneratorParams { EchoModuleParams echo_test_module = 3; ordererpb.PBFTModule pbft_module = 4; pprepvalidatorpb.PPrepValidatorChkp ppv_module = 5; + granitepb.InstanceParams granite = 6; } } diff --git a/protos/generate.go b/protos/generate.go index b16ff152b..5fb187557 100644 --- a/protos/generate.go +++ b/protos/generate.go @@ -45,6 +45,8 @@ package protos //go:generate protoc-events transportpb/transportpb.proto //go:generate protoc-events testerpb/testerpb.proto +//go:generate protoc-events granitepb/granitepb.proto + // Build the custom code generators. //go:generate go build -o ../codegen/generators/mir-std-gen/mir-std-gen.bin ../codegen/generators/mir-std-gen //go:generate -command std-gen ../codegen/generators/mir-std-gen/mir-std-gen.bin @@ -76,6 +78,8 @@ package protos //go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/testerpb" //go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/pingpongpb" +//go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/granitepb" + // Generate other things. //go:generate protoc --go_out=../pkg/ --go_opt=paths=source_relative --go-grpc_out=../pkg/ --go-grpc_opt=paths=source_relative transactionreceiver/transactionreceiver.proto //go:generate protoc --go_out=../pkg/ --go_opt=paths=source_relative --go-grpc_out=../pkg/ --go-grpc_opt=paths=source_relative net/grpc/grpctransport.proto diff --git a/protos/granitepb/granitepb.proto b/protos/granitepb/granitepb.proto new file mode 100644 index 000000000..9ec983412 --- /dev/null +++ b/protos/granitepb/granitepb.proto @@ -0,0 +1,87 @@ +syntax = "proto3"; + +package granitepb; + +option go_package = "github.com/filecoin-project/mir/pkg/pb/granitepb"; + +import "trantorpb/trantorpb.proto"; + +import "mir/codegen_extensions.proto"; +import "net/codegen_extensions.proto"; + +message Message { + option (net.message_class) = true; + + oneof type { + option (net.message_type) = true; + + Converge converge = 1; + Propose propose = 2; + Prepare prepare = 3; + Commit commit = 4; + Decision decision = 5; + ConsensusMsg consensus_msg = 6; + } +} + +message ConsensusMsg { + option (net.message) = true; + int32 msg_type = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/granite/types.MsgType"]; + uint64 round = 2 [(mir.type) = "github.com/filecoin-project/mir/pkg/granite/types.RoundNr"]; + bytes data = 3; + Ticket ticket = 4; + bytes signature = 5; +} +// ATT: HERE BELOW THERE ARE SEPARATED DESCRIPTIONS OF EACH MESSAGE, BUT IN ORDER TO MINIMIZE MIR-DEPENDANT CODE I HAVE PUT THEM ALL IN ONE MESSAGE ABOVE. +// +//message Converge{ +// option (net.message) = true; +// +// uint64 round = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/granite/types.RoundNr"]; +// bytes data = 2; +// Ticket ticket = 3; +// bytes signature = 4; +//} +// +//message Ticket { +// option (mir.struct) = true; +// bytes data = 1; // TODO include actual ticket based on VRF proofs +//} +// +//message Propose { +// option (net.message) = true; +// +// uint64 round = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/granite/types.RoundNr"]; +// bytes data = 2; +// bytes signature = 3; +//} +// +//message Prepare { +// option (net.message) = true; +// +// uint64 round = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/granite/types.RoundNr"]; +// bytes data = 2; +// bytes signature = 3; +//} +// +//message Commit { +// option (net.message) = true; +// +// uint64 round = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/granite/types.RoundNr"]; +// bytes data = 2; +// bytes signature = 3; +//} + +message Decision { + option (net.message) = true; + + bytes data = 1; + bytes signature = 2; +} + +message InstanceParams { + option (mir.struct) = true; + + uint64 instance_uid = 1; + trantorpb.Membership membership = 2; +} \ No newline at end of file diff --git a/protos/messagepb/messagepb.proto b/protos/messagepb/messagepb.proto index b440113e6..39ac7202f 100644 --- a/protos/messagepb/messagepb.proto +++ b/protos/messagepb/messagepb.proto @@ -16,6 +16,7 @@ import "availabilitypb/mscpb/mscpb.proto"; import "pingpongpb/pingpongpb.proto"; import "checkpointpb/checkpointpb.proto"; import "ordererpb/ordererpb.proto"; +import "granitepb/granitepb.proto"; import "mir/codegen_extensions.proto"; import "net/codegen_extensions.proto"; @@ -34,5 +35,6 @@ message Message { pingpongpb.Message pingpong = 5; checkpointpb.Message checkpoint = 6; ordererpb.Message orderer = 7; + granitepb.Message granite = 8; } } From 99b6ecb03d1acbde1a3854ccbb561314a5686ad8 Mon Sep 17 00:00:00 2001 From: Alejandro Ranchal-Pedrosa Date: Sat, 9 Sep 2023 18:10:46 +0200 Subject: [PATCH 2/6] Implement skeleton and state of Granite module --- pkg/granite/common/common.go | 68 +++++++++++++++++++++++++++++ pkg/granite/granite.go | 83 ++++++++++++++++++++++++++++++++++++ pkg/granite/types.go | 78 +++++++++++++++++++++++++++++++++ 3 files changed, 229 insertions(+) create mode 100644 pkg/granite/common/common.go create mode 100644 pkg/granite/granite.go create mode 100644 pkg/granite/types.go diff --git a/pkg/granite/common/common.go b/pkg/granite/common/common.go new file mode 100644 index 000000000..f8830362a --- /dev/null +++ b/pkg/granite/common/common.go @@ -0,0 +1,68 @@ +package common + +import ( + "github.com/filecoin-project/mir/pkg/crypto" + "github.com/filecoin-project/mir/pkg/granite" + granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + trantorpbtypes "github.com/filecoin-project/mir/pkg/pb/trantorpb/types" + t "github.com/filecoin-project/mir/pkg/types" +) + +// ModuleConfig sets the module ids. All replicas are expected to use identical module configurations. +type ModuleConfig struct { + Self t.ModuleID // id of this module + App t.ModuleID + Ava t.ModuleID + Crypto t.ModuleID + Hasher t.ModuleID + Net t.ModuleID + Ord t.ModuleID + PPrepValidator t.ModuleID + Timer t.ModuleID +} + +// ModuleParams sets the values for the parameters of an instance of the protocol. +// All replicas are expected to use identical module parameters. +type ModuleParams struct { + + // InstanceUID is a unique identifier for this instance used to prevent replay attacks. + InstanceUID []byte `json:"-"` + + // Membership defines the set of nodes participating in a particular instance of Granite. + Membership *trantorpbtypes.Membership `json:"-"` + + Crypto crypto.Crypto +} + +type Step = granite.MsgType +type State struct { + Round granite.RoundNr + Step Step + + ValidatedMsgs *granite.MsgStore + UnvalidatedMsgs *granite.MsgStore + + //Decision messages do not need to be stored per round + DecisionMessages map[t.NodeID]map[string]*granitepbtypes.Decision +} + +func (st *State) IsValid(msg *granitepbtypes.ConsensusMsg) bool { + //TODO implement message validation logic (algorithm 5 currently in Overleaf's doc) + return true +} + +// TODO this can be optimized +func (st *State) FindNewValid() (*granitepbtypes.ConsensusMsg, t.NodeID, bool) { + for _, store := range st.UnvalidatedMsgs.Msgs { + for _, nodeMap := range store { + for source, value := range nodeMap { + if st.IsValid(value) { + return value, source, true + } + } + } + } + + var source t.NodeID + return nil, source, false +} diff --git a/pkg/granite/granite.go b/pkg/granite/granite.go new file mode 100644 index 000000000..46d8af7e9 --- /dev/null +++ b/pkg/granite/granite.go @@ -0,0 +1,83 @@ +package granite + +import ( + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/factorymodule" + "github.com/filecoin-project/mir/pkg/granite/common" + "github.com/filecoin-project/mir/pkg/granite/internal/parts/consensustask" + "github.com/filecoin-project/mir/pkg/granite/internal/parts/messagehandlertask" + "github.com/filecoin-project/mir/pkg/logging" + "github.com/filecoin-project/mir/pkg/modules" + factorypbtypes "github.com/filecoin-project/mir/pkg/pb/factorypb/types" + granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + t "github.com/filecoin-project/mir/pkg/types" +) + +// ModuleConfig sets the module ids. All replicas are expected to use identical module configurations. +type ModuleConfig = common.ModuleConfig + +// ModuleParams sets the values for the parameters of an instance of the protocol. +// All replicas are expected to use identical module parameters. +type ModuleParams = common.ModuleParams + +// NewModule creates a new instance of the Granite consensus protocol +func NewModule(mc ModuleConfig, params *ModuleParams, logger logging.Logger) (modules.PassiveModule, error) { + m := dsl.NewModule(mc.Self) + + state := &common.State{ + Round: 0, + Step: PROPOSE, // First round skip CONVERGE step + ValidatedMsgs: NewMsgStore(), + UnvalidatedMsgs: NewMsgStore(), + DecisionMessages: make(map[t.NodeID]map[string]*granitepbtypes.Decision), + } + + //init data structure to store all messages + //TODO init maps + + // Include the core logic of the protocol. + consensustask.IncludeConsensusTask(m, mc, params, state, logger) + messagehandlertask.IncludeMessageHandlerTask(m, mc, params, state, logger) + + return m, nil +} + +func NewReconfigurableModule(mc ModuleConfig, paramsTemplate ModuleParams, logger logging.Logger) modules.PassiveModule { + if logger == nil { + logger = logging.ConsoleErrorLogger + } + return factorymodule.New( + mc.Self, + factorymodule.DefaultParams( + + // This function will be called whenever the factory module + // is asked to create a new instance of granite. + func(graniteID t.ModuleID, params *factorypbtypes.GeneratorParams) (modules.PassiveModule, error) { + + // Extract the IDs of the nodes in the membership associated with this instance + graniteParams := params.Type.(*factorypbtypes.GeneratorParams_Granite).Granite + + // Create a copy of basic module config with an adapted ID for the submodule. + submc := mc + submc.Self = graniteID + + // Fill in instance-specific parameters. + moduleParams := paramsTemplate + moduleParams.InstanceUID = []byte(graniteID) + moduleParams.Membership = graniteParams.Membership + + // Create a new instance of granite. + granite, err := NewModule( + submc, + &moduleParams, + logger, + ) + if err != nil { + return nil, err + } + return granite, nil + }, + ), + logger, + ) +} diff --git a/pkg/granite/types.go b/pkg/granite/types.go new file mode 100644 index 000000000..8c43e35ad --- /dev/null +++ b/pkg/granite/types.go @@ -0,0 +1,78 @@ +package granite + +import ( + granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + t "github.com/filecoin-project/mir/pkg/types" +) + +type RoundNr uint64 + +// InstanceUID is used to uniquely identify an instance of Granite. +// It is used to prevent cross-instance signature replay attack and should be unique across all executions. +type InstanceUID uint64 + +type StepMsgStore[Value any] map[RoundNr]map[t.NodeID]Value + +func (sms StepMsgStore[Value]) EnsureRound(roundNr RoundNr) { + if _, ok := sms[roundNr]; !ok { + sms[roundNr] = make(map[t.NodeID]Value) + } +} + +func (sms StepMsgStore[Value]) StoreMessage(roundNr RoundNr, nodeID t.NodeID, message Value) { + sms.EnsureRound(roundNr) + sms[roundNr][nodeID] = message +} + +func (sms StepMsgStore[Value]) Get(round RoundNr, nodeID t.NodeID) (Value, bool) { + if nodes, ok := sms[round]; ok { + if val, ok := nodes[nodeID]; ok { + return val, ok + } + } + + var val Value + return val, false +} + +type MsgStore struct { + //Storing all messages as it is relevant for validation + Msgs map[MsgType]StepMsgStore[*granitepbtypes.ConsensusMsg] +} + +func NewMsgStore() *MsgStore { + msgStore := make(map[MsgType]StepMsgStore[*granitepbtypes.ConsensusMsg]) + msgStore[CONVERGE] = make(StepMsgStore[*granitepbtypes.ConsensusMsg]) + msgStore[PROPOSE] = make(StepMsgStore[*granitepbtypes.ConsensusMsg]) + msgStore[PREPARE] = make(StepMsgStore[*granitepbtypes.ConsensusMsg]) + msgStore[COMMIT] = make(StepMsgStore[*granitepbtypes.ConsensusMsg]) + + return &MsgStore{ + Msgs: msgStore, + } +} + +// Get method for the MsgStore +func (mst *MsgStore) Get(msgType MsgType, round RoundNr, nodeID t.NodeID) (*granitepbtypes.ConsensusMsg, bool) { + if msg, ok := mst.Msgs[msgType].Get(round, nodeID); ok { + return msg, ok + } + return nil, false +} + +func (mst *MsgStore) StoreMessage(msgType MsgType, round RoundNr, nodeID t.NodeID, message *granitepbtypes.ConsensusMsg) { + mst.Msgs[msgType].StoreMessage(round, nodeID, message) +} + +func (mst *MsgStore) RemoveMessage(msgType MsgType, round RoundNr, nodeID t.NodeID, key string) { + delete(mst.Msgs[msgType][round], nodeID) +} + +type MsgType int32 //Protos do not support uint8 but this should be uint8 + +const ( + CONVERGE MsgType = iota + PROPOSE + PREPARE + COMMIT +) From d17f8d98d885054764042bc3161e906cf6f90ab9 Mon Sep 17 00:00:00 2001 From: Alejandro Ranchal-Pedrosa Date: Sat, 9 Sep 2023 18:11:19 +0200 Subject: [PATCH 3/6] Implement core logic skeleton and messagehandler task --- .../parts/consensustask/consensustask.go | 149 ++++++++++++++++++ .../messagehandlertask/messagehandlertask.go | 71 +++++++++ pkg/granite/types.go | 7 +- protos/granitepb/granitepb.proto | 8 +- 4 files changed, 230 insertions(+), 5 deletions(-) create mode 100644 pkg/granite/internal/parts/consensustask/consensustask.go create mode 100644 pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go diff --git a/pkg/granite/internal/parts/consensustask/consensustask.go b/pkg/granite/internal/parts/consensustask/consensustask.go new file mode 100644 index 000000000..a24aa4ee2 --- /dev/null +++ b/pkg/granite/internal/parts/consensustask/consensustask.go @@ -0,0 +1,149 @@ +package consensustask + +import ( + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/granite" + "github.com/filecoin-project/mir/pkg/granite/common" + "github.com/filecoin-project/mir/pkg/logging" + eventpbdsl "github.com/filecoin-project/mir/pkg/pb/eventpb/dsl" + granitepbmsgs "github.com/filecoin-project/mir/pkg/pb/granitepb/msgs" + granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + transportpbdsl "github.com/filecoin-project/mir/pkg/pb/transportpb/dsl" + "github.com/filecoin-project/mir/pkg/types" + "github.com/filecoin-project/mir/pkg/util/maputil" +) + +// IncludeConsensusTask registers event handlers for the core logic of Granite. +func IncludeConsensusTask( + m dsl.Module, + mc common.ModuleConfig, + params *common.ModuleParams, + state *common.State, + logger logging.Logger, +) { + + // TODO for now we immediately send a dummy propose UponInit, replace to whatever module provides the proposal + eventpbdsl.UponInit(m, func() error { + proposal := []byte("test") // TODO get proposal + + var signature []byte // TODO for now we assume a dummy signature + signature, err := params.Crypto.Sign([][]byte{proposal, params.InstanceUID, state.Round.Bytes()}) + + if err != nil { + return err + } + + //sendConverge + transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.PROPOSE, state.Round, proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + return nil + }) +} + +// TODO Actually implement this function with the core logic of Granite +func MsgValidated(m dsl.Module, + state *common.State, + from types.NodeID, + msg *granitepbtypes.ConsensusMsg) { + //TODO implement discarding messages for old rounds and buffering msgs for new rounds + + switch msg.MsgType { + case granite.CONVERGE: + ConvergeValidated( + m, + state, + from, + msg.Round, + msg.Data, + msg.Ticket, + msg.Signature, + ) + case granite.PROPOSE: + ProposeValidated( + m, + state, + from, + msg.Round, + msg.Data, + msg.Signature, + ) + case granite.PREPARE: + PrepareValidated( + m, + state, + from, + msg.Round, + msg.Data, + msg.Signature, + ) + case granite.COMMIT: + CommitValidated( + m, + state, + from, + msg.Round, + msg.Data, + msg.Signature, + ) + } +} + +func ConvergeValidated(m dsl.Module, + state *common.State, + from types.NodeID, + round granite.RoundNr, + data []uint8, + ticket *granitepbtypes.Ticket, + signature []uint8, +) error { + // TODO check signature, ticket, round + // TODO other checks... + + // TODO Store for when the timer comes to check for lowes ticket + + return nil +} + +func ProposeValidated(m dsl.Module, + state *common.State, + from types.NodeID, + round granite.RoundNr, + data []uint8, + signature []uint8, +) error { + // TODO check signature, ticket, round + // TODO other checks... + + // TODO check if we have enough messages to move to next step + + return nil +} + +func PrepareValidated(m dsl.Module, + state *common.State, + from types.NodeID, + round granite.RoundNr, + data []uint8, + signature []uint8, +) error { + // TODO check signature, ticket, round + // TODO other checks... + + // TODO check if we have enough messages to move to next step + + return nil +} + +func CommitValidated(m dsl.Module, + state *common.State, + from types.NodeID, + round granite.RoundNr, + data []uint8, + signature []uint8, +) error { + // TODO check signature, ticket, round + // TODO other checks... + + // TODO check if we have enough messages to move to next step + // TODO Implement await 2Delta after sending CONVERGE, probably by calling a function that calls the timer module + return nil +} diff --git a/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go b/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go new file mode 100644 index 000000000..624515ed6 --- /dev/null +++ b/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go @@ -0,0 +1,71 @@ +package messagehandlertask + +import ( + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/granite" + "github.com/filecoin-project/mir/pkg/granite/common" + "github.com/filecoin-project/mir/pkg/granite/internal/parts/consensustask" + "github.com/filecoin-project/mir/pkg/logging" + granitepbdsl "github.com/filecoin-project/mir/pkg/pb/granitepb/dsl" + granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + "github.com/filecoin-project/mir/pkg/types" +) + +// IncludeMessageHandlerTask registers event handlers for the buffering and validation of Granite messages before delivering them to the core logic. +func IncludeMessageHandlerTask( + m dsl.Module, + mc common.ModuleConfig, + params *common.ModuleParams, + state *common.State, + logger logging.Logger, +) { + + granitepbdsl.UponConsensusMsgReceived(m, func(from types.NodeID, msgType granite.MsgType, round granite.RoundNr, data []uint8, ticket *granitepbtypes.Ticket, signature []uint8) error { + if _, ok := state.UnvalidatedMsgs.Get(msgType, round, from); ok { + return nil // message already received or duplicate, discarding + } else if _, ok := state.ValidatedMsgs.Get(msgType, round, from); ok { + return nil // message already received or duplicate, discarding + } + + //Verify signature + toVerify := [][]byte{data, params.InstanceUID, round.Bytes()} + if msgType == granite.CONVERGE { + if ticket == nil { + logger.Log(logging.LevelWarn, "Ticket is nil") + return nil + } + + toVerify = append(toVerify, ticket.Data) + } + + if err := params.Crypto.Verify(toVerify, signature, from); err != nil { + logger.Log(logging.LevelWarn, "Signature verification failed") + return nil + } + + //TODO add check for external validity -- in mir probably asking the availability module + + msg := &granitepbtypes.ConsensusMsg{ + Round: round, + Data: data, + Ticket: ticket, + Signature: signature, + } + + state.UnvalidatedMsgs.StoreMessage(msgType, round, from, msg) + + for msg, source, ok := state.FindNewValid(); ok; msg, source, ok = state.FindNewValid() { + state.UnvalidatedMsgs.RemoveMessage(msgType, round, from) + state.ValidatedMsgs.StoreMessage(msgType, round, from, msg) + + consensustask.MsgValidated(m, + state, + source, + msg, + ) + } + + return nil + }) + +} diff --git a/pkg/granite/types.go b/pkg/granite/types.go index 8c43e35ad..d69145d5a 100644 --- a/pkg/granite/types.go +++ b/pkg/granite/types.go @@ -2,11 +2,16 @@ package granite import ( granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + "github.com/filecoin-project/mir/pkg/serializing" t "github.com/filecoin-project/mir/pkg/types" ) type RoundNr uint64 +func (r RoundNr) Bytes() []byte { + return serializing.Uint64ToBytes(uint64(r)) +} + // InstanceUID is used to uniquely identify an instance of Granite. // It is used to prevent cross-instance signature replay attack and should be unique across all executions. type InstanceUID uint64 @@ -64,7 +69,7 @@ func (mst *MsgStore) StoreMessage(msgType MsgType, round RoundNr, nodeID t.NodeI mst.Msgs[msgType].StoreMessage(round, nodeID, message) } -func (mst *MsgStore) RemoveMessage(msgType MsgType, round RoundNr, nodeID t.NodeID, key string) { +func (mst *MsgStore) RemoveMessage(msgType MsgType, round RoundNr, nodeID t.NodeID) { delete(mst.Msgs[msgType][round], nodeID) } diff --git a/protos/granitepb/granitepb.proto b/protos/granitepb/granitepb.proto index 9ec983412..b7621aaf5 100644 --- a/protos/granitepb/granitepb.proto +++ b/protos/granitepb/granitepb.proto @@ -43,10 +43,10 @@ message ConsensusMsg { // bytes signature = 4; //} // -//message Ticket { -// option (mir.struct) = true; -// bytes data = 1; // TODO include actual ticket based on VRF proofs -//} +message Ticket { + option (mir.struct) = true; + bytes data = 1; // TODO include actual ticket based on VRF proofs +} // //message Propose { // option (net.message) = true; From 047fb0c500949ed41aa9d798fc568a033c037c0c Mon Sep 17 00:00:00 2001 From: Alejandro Ranchal-Pedrosa Date: Sun, 10 Sep 2023 11:13:09 +0200 Subject: [PATCH 4/6] Implement consensus task (WIP) --- pkg/granite/common/common.go | 6 + pkg/granite/granite.go | 4 +- .../parts/consensustask/consensustask.go | 335 +++++++++-- .../messagehandlertask/messagehandlertask.go | 4 +- pkg/pb/eventpb/eventpb.pb.go | 329 ++++++----- pkg/pb/eventpb/eventpb.pb.mir.go | 1 + pkg/pb/eventpb/oneof_interfaces.mir.go | 5 + pkg/pb/eventpb/types/types.mir.go | 77 ++- pkg/pb/granitepb/dsl/messages.mir.go | 24 - pkg/pb/granitepb/granitepb.pb.go | 531 +++++------------- pkg/pb/granitepb/granitepb.pb.mir.go | 10 +- pkg/pb/granitepb/msgs/msgs.mir.go | 85 +-- pkg/pb/granitepb/oneof_interfaces.mir.go | 25 +- pkg/pb/granitepb/types/types.mir.go | 288 +++------- protos/eventpb/eventpb.proto | 5 + protos/granitepb/granitepb.proto | 25 +- 16 files changed, 789 insertions(+), 965 deletions(-) diff --git a/pkg/granite/common/common.go b/pkg/granite/common/common.go index f8830362a..dcec0f09d 100644 --- a/pkg/granite/common/common.go +++ b/pkg/granite/common/common.go @@ -6,6 +6,7 @@ import ( granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" trantorpbtypes "github.com/filecoin-project/mir/pkg/pb/trantorpb/types" t "github.com/filecoin-project/mir/pkg/types" + "time" ) // ModuleConfig sets the module ids. All replicas are expected to use identical module configurations. @@ -32,6 +33,8 @@ type ModuleParams struct { Membership *trantorpbtypes.Membership `json:"-"` Crypto crypto.Crypto + + ConvergeDelay time.Duration } type Step = granite.MsgType @@ -44,6 +47,9 @@ type State struct { //Decision messages do not need to be stored per round DecisionMessages map[t.NodeID]map[string]*granitepbtypes.Decision + + Proposal []byte + Value []byte } func (st *State) IsValid(msg *granitepbtypes.ConsensusMsg) bool { diff --git a/pkg/granite/granite.go b/pkg/granite/granite.go index 46d8af7e9..141d28ba1 100644 --- a/pkg/granite/granite.go +++ b/pkg/granite/granite.go @@ -21,7 +21,7 @@ type ModuleConfig = common.ModuleConfig type ModuleParams = common.ModuleParams // NewModule creates a new instance of the Granite consensus protocol -func NewModule(mc ModuleConfig, params *ModuleParams, logger logging.Logger) (modules.PassiveModule, error) { +func NewModule(mc *ModuleConfig, params *ModuleParams, logger logging.Logger) (modules.PassiveModule, error) { m := dsl.NewModule(mc.Self) state := &common.State{ @@ -68,7 +68,7 @@ func NewReconfigurableModule(mc ModuleConfig, paramsTemplate ModuleParams, logge // Create a new instance of granite. granite, err := NewModule( - submc, + &submc, &moduleParams, logger, ) diff --git a/pkg/granite/internal/parts/consensustask/consensustask.go b/pkg/granite/internal/parts/consensustask/consensustask.go index a24aa4ee2..81411e58f 100644 --- a/pkg/granite/internal/parts/consensustask/consensustask.go +++ b/pkg/granite/internal/parts/consensustask/consensustask.go @@ -6,17 +6,26 @@ import ( "github.com/filecoin-project/mir/pkg/granite/common" "github.com/filecoin-project/mir/pkg/logging" eventpbdsl "github.com/filecoin-project/mir/pkg/pb/eventpb/dsl" + eventpbtypes "github.com/filecoin-project/mir/pkg/pb/eventpb/types" + granitepbdsl "github.com/filecoin-project/mir/pkg/pb/granitepb/dsl" + granitepbevents "github.com/filecoin-project/mir/pkg/pb/granitepb/events" granitepbmsgs "github.com/filecoin-project/mir/pkg/pb/granitepb/msgs" granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" transportpbdsl "github.com/filecoin-project/mir/pkg/pb/transportpb/dsl" + trantorpbtypes "github.com/filecoin-project/mir/pkg/pb/trantorpb/types" + timertypes "github.com/filecoin-project/mir/pkg/timer/types" "github.com/filecoin-project/mir/pkg/types" "github.com/filecoin-project/mir/pkg/util/maputil" + "github.com/filecoin-project/mir/pkg/util/membutil" + "github.com/filecoin-project/mir/pkg/util/sliceutil" + "math/rand" + "time" ) // IncludeConsensusTask registers event handlers for the core logic of Granite. func IncludeConsensusTask( m dsl.Module, - mc common.ModuleConfig, + mc *common.ModuleConfig, params *common.ModuleParams, state *common.State, logger logging.Logger, @@ -24,17 +33,29 @@ func IncludeConsensusTask( // TODO for now we immediately send a dummy propose UponInit, replace to whatever module provides the proposal eventpbdsl.UponInit(m, func() error { - proposal := []byte("test") // TODO get proposal + state.Proposal = []byte("test") // TODO get proposal + state.Value = state.Proposal - var signature []byte // TODO for now we assume a dummy signature - signature, err := params.Crypto.Sign([][]byte{proposal, params.InstanceUID, state.Round.Bytes()}) + var signature []byte + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) if err != nil { return err } - //sendConverge - transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.PROPOSE, state.Round, proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + //Send PROPOSE (first round Converge is skipped) + transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.PROPOSE, state.Round, state.Proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + return nil + }) + + granitepbdsl.UponConvergeTimeout(m, func() error { + checkConverge( + m, + state, + params, + mc, + ) + return nil }) } @@ -42,6 +63,8 @@ func IncludeConsensusTask( // TODO Actually implement this function with the core logic of Granite func MsgValidated(m dsl.Module, state *common.State, + params *common.ModuleParams, + mc *common.ModuleConfig, from types.NodeID, msg *granitepbtypes.ConsensusMsg) { //TODO implement discarding messages for old rounds and buffering msgs for new rounds @@ -61,28 +84,25 @@ func MsgValidated(m dsl.Module, ProposeValidated( m, state, - from, + params, + mc, msg.Round, - msg.Data, - msg.Signature, ) case granite.PREPARE: PrepareValidated( m, state, - from, + params, + mc, msg.Round, - msg.Data, - msg.Signature, ) case granite.COMMIT: CommitValidated( m, state, - from, + params, + mc, msg.Round, - msg.Data, - msg.Signature, ) } } @@ -95,55 +115,294 @@ func ConvergeValidated(m dsl.Module, ticket *granitepbtypes.Ticket, signature []uint8, ) error { - // TODO check signature, ticket, round - // TODO other checks... - - // TODO Store for when the timer comes to check for lowes ticket + // Do nothing, we move only once the timer has expired + //TODO optimization: move if we have received messages from ALL nodes even if timer has not timed out yet return nil } +func checkConverge( + m dsl.Module, + state *common.State, + params *common.ModuleParams, + mc *common.ModuleConfig, +) error { + state.Value = getValueMinimumTicket(params.Membership, state.ValidatedMsgs.Msgs[granite.CONVERGE][state.Round]) + transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.PROPOSE, state.Round, state.Proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + + state.Step = granite.PROPOSE + + //It could be that we have already received enough PREPARE messages to move to the next step + checkPropose( + m, + state, + params, + mc, + ) +} + func ProposeValidated(m dsl.Module, state *common.State, - from types.NodeID, + params *common.ModuleParams, + mc *common.ModuleConfig, round granite.RoundNr, - data []uint8, - signature []uint8, ) error { - // TODO check signature, ticket, round - // TODO other checks... - // TODO check if we have enough messages to move to next step + if round != state.Round { + return nil + } + if state.Step != granite.PROPOSE { + return nil + } + + return checkPropose(m, state, params, mc) +} +func checkPropose( + m dsl.Module, + state *common.State, + params *common.ModuleParams, + mc *common.ModuleConfig, +) error { + nodeIDs := maputil.GetKeys(state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) + + // Check for strong quorum + if !membutil.HaveStrongQuorum(params.Membership, nodeIDs) { + return nil + } + + mode := findMode( + sliceutil.Transform( + maputil.GetValues(state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]), func(msg *granitepbtypes.ConsensusMsg) string { + return string(msg.Data) + }), + ) + state.Value = []byte(mode) + + var signature []byte + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) + if err != nil { + return err + } + + //Send PREPARE + transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.PREPARE, state.Round, state.Proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + + state.Step = granite.PREPARE + + //It could be that we have already received enough PREPARE messages to move to the next step + checkPrepare( + m, + state, + params, + mc, + ) return nil } func PrepareValidated(m dsl.Module, state *common.State, - from types.NodeID, + params *common.ModuleParams, + mc *common.ModuleConfig, round granite.RoundNr, - data []uint8, - signature []uint8, ) error { - // TODO check signature, ticket, round - // TODO other checks... + if round != state.Round { + return nil + } + if state.Step != granite.PROPOSE { + return nil + } - // TODO check if we have enough messages to move to next step + checkPrepare( + m, + state, + params, + mc, + ) + return nil +} + +func checkPrepare( + m dsl.Module, + state *common.State, + params *common.ModuleParams, + mc *common.ModuleConfig, +) error { + nodeIDs := maputil.GetKeys(state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) + + // Check for strong quorum + if !membutil.HaveStrongQuorum(params.Membership, nodeIDs) { + return nil + } + + updatedValue := getValueWithQuorum(params.Membership, state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) + state.Value = nil + if updatedValue != nil { + state.Value = updatedValue + } + + var signature []byte + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) + if err != nil { + return err + } + + //Send COMMIT + transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.COMMIT, state.Round, state.Proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + + state.Step = granite.COMMIT + + checkCommit( + m, + state, + params, + mc, + ) return nil } func CommitValidated(m dsl.Module, state *common.State, - from types.NodeID, + params *common.ModuleParams, + mc *common.ModuleConfig, round granite.RoundNr, - data []uint8, - signature []uint8, ) error { - // TODO check signature, ticket, round - // TODO other checks... + if round != state.Round { + return nil + } + if state.Step != granite.COMMIT { + return nil + } - // TODO check if we have enough messages to move to next step - // TODO Implement await 2Delta after sending CONVERGE, probably by calling a function that calls the timer module + checkCommit( + m, + state, + params, + mc, + ) return nil } + +func checkCommit( + m dsl.Module, + state *common.State, + params *common.ModuleParams, + mc *common.ModuleConfig, +) error { + nodeIDs := maputil.GetKeys(state.ValidatedMsgs.Msgs[granite.PREPARE][state.Round]) + + // Check for strong quorum + if !membutil.HaveStrongQuorum(params.Membership, nodeIDs) { + return nil + } + + state.Value = getValueWithQuorum(params.Membership, state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) + if state.Value != nil { + //FINISHED + decide(...) + return nil + } + + state.Value = getValue(maputil.GetValues(state.ValidatedMsgs.Msgs[granite.PREPARE][state.Round])) + state.Round++ + state.Step = granite.CONVERGE + + var signature []byte + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) + if err != nil { + return err + } + + //Send CONVERGE if not finished + transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.COMMIT, state.Round, state.Proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + // Set up a new timer for the next proposal. + timeoutEvent := granitepbevents.ConvergeTimeout( + mc.Self) + + eventpbdsl.TimerDelay(m, + mc.Timer, + []*eventpbtypes.Event{timeoutEvent}, + timertypes.Duration(params.ConvergeDelay), + ) + return nil +} + +// ------------------ Helper functions ------------------ + +func findMode[T comparable](dataList []T) T { + dataCountMap := make(map[T]int) + + // Iterate through each data and count occurrences + for _, data := range dataList { + dataCountMap[data]++ + } + + var modeData T + maxCount := 0 + + // Find the data that occurs most frequently + for data, count := range dataCountMap { + if count > maxCount { + maxCount = count + modeData = data + } + } + + return modeData +} + +// getValueWithQuorum returns a value if it gathers at least a strong quorum. +// If no value has a strong quorum, it returns the default value. +func getValueWithQuorum(membership *trantorpbtypes.Membership, messages map[types.NodeID]*granitepbtypes.ConsensusMsg) []byte { + + // Store the occurrence counts of each string value and the nodes that vouched for it + valueNodes := make(map[string][]types.NodeID) + + // Populate valueCounts and valueNodes + for source, msg := range messages { + data := string(msg.Data) // Assuming the field is named Data and is of type string + if _, exists := valueNodes[data]; !exists { + valueNodes[data] = []types.NodeID{} + } + valueNodes[data] = append(valueNodes[data], source) // Assuming each message has a NodeID field + } + + // Check each string value to see if it meets the strong quorum requirement + for data, _ := range valueNodes { + if membutil.HaveStrongQuorum(membership, valueNodes[data]) { + return []byte(data) + } + } + + // If no value met the requirement, return the default value + return nil +} + +// getValue returns one of the non-empty values at random. +func getValue(messages []*granitepbtypes.ConsensusMsg) []byte { + nonEmptyValues := [][]byte{} + + // Populate nonEmptyValues with non-empty string values from messages + for _, msg := range messages { + data := msg.Data // Assuming the field is named Data and is of type string + if data != nil { + nonEmptyValues = append(nonEmptyValues, data) + } + } + + // If there are no non-empty values, return an empty string + if len(nonEmptyValues) == 0 { + return nil + } + + // Seed the random number generator and select a value randomly + rand.Seed(time.Now().UnixNano()) + return nonEmptyValues[rand.Intn(len(nonEmptyValues))] +} + +// getValueMinimumTicket returns the value with the lowest ticket. +func getValueMinimumTicket(membership *trantorpbtypes.Membership, messages map[types.NodeID]*granitepbtypes.ConsensusMsg) []byte { + //TODO implement (return nil if empty, although at least local value should be part of set) + return nil +} \ No newline at end of file diff --git a/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go b/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go index 624515ed6..8f8c24cbc 100644 --- a/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go +++ b/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go @@ -14,7 +14,7 @@ import ( // IncludeMessageHandlerTask registers event handlers for the buffering and validation of Granite messages before delivering them to the core logic. func IncludeMessageHandlerTask( m dsl.Module, - mc common.ModuleConfig, + mc *common.ModuleConfig, params *common.ModuleParams, state *common.State, logger logging.Logger, @@ -60,6 +60,8 @@ func IncludeMessageHandlerTask( consensustask.MsgValidated(m, state, + params, + mc, source, msg, ) diff --git a/pkg/pb/eventpb/eventpb.pb.go b/pkg/pb/eventpb/eventpb.pb.go index 3a05b4fdf..356e0cc99 100644 --- a/pkg/pb/eventpb/eventpb.pb.go +++ b/pkg/pb/eventpb/eventpb.pb.go @@ -16,6 +16,7 @@ import ( chkpvalidatorpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb/chkpvalidatorpb" cryptopb "github.com/filecoin-project/mir/pkg/pb/cryptopb" factorypb "github.com/filecoin-project/mir/pkg/pb/factorypb" + granitepb "github.com/filecoin-project/mir/pkg/pb/granitepb" hasherpb "github.com/filecoin-project/mir/pkg/pb/hasherpb" isspb "github.com/filecoin-project/mir/pkg/pb/isspb" mempoolpb "github.com/filecoin-project/mir/pkg/pb/mempoolpb" @@ -66,6 +67,7 @@ type Event struct { // *Event_Transport // *Event_ChkpValidator // *Event_PprepValiadtor + // *Event_Granite // *Event_PingPong // *Event_TestingString // *Event_TestingUint @@ -253,6 +255,13 @@ func (x *Event) GetPprepValiadtor() *pprepvalidatorpb.Event { return nil } +func (x *Event) GetGranite() *granitepb.Event { + if x, ok := x.GetType().(*Event_Granite); ok { + return x.Granite + } + return nil +} + func (x *Event) GetPingPong() *pingpongpb.Event { if x, ok := x.GetType().(*Event_PingPong); ok { return x.PingPong @@ -367,6 +376,10 @@ type Event_PprepValiadtor struct { PprepValiadtor *pprepvalidatorpb.Event `protobuf:"bytes,25,opt,name=pprep_valiadtor,json=pprepValiadtor,proto3,oneof"` } +type Event_Granite struct { + Granite *granitepb.Event `protobuf:"bytes,26,opt,name=granite,proto3,oneof"` +} + type Event_PingPong struct { // Events for code samples PingPong *pingpongpb.Event `protobuf:"bytes,200,opt,name=ping_pong,json=pingPong,proto3,oneof"` @@ -421,6 +434,8 @@ func (*Event_ChkpValidator) isEvent_Type() {} func (*Event_PprepValiadtor) isEvent_Type() {} +func (*Event_Granite) isEvent_Type() {} + func (*Event_PingPong) isEvent_Type() {} func (*Event_TestingString) isEvent_Type() {} @@ -770,141 +785,146 @@ var file_eventpb_eventpb_proto_rawDesc = []byte{ 0x73, 0x70, 0x6f, 0x72, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xf9, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x36, 0x82, 0xa6, 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x44, 0x52, 0x0a, 0x64, 0x65, 0x73, 0x74, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x69, 0x74, - 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x74, 0x69, 0x6d, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, - 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, - 0x74, 0x69, 0x6d, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x72, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x65, 0x72, 0x70, 0x62, - 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x72, - 0x12, 0x20, 0x0a, 0x03, 0x62, 0x63, 0x62, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x62, 0x63, 0x62, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x62, - 0x63, 0x62, 0x12, 0x2c, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x70, 0x62, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, - 0x12, 0x3b, 0x0a, 0x0c, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, - 0x0c, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x2d, 0x0a, - 0x08, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x64, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x62, 0x61, 0x74, 0x63, 0x68, 0x64, 0x62, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, 0x62, 0x12, 0x3c, 0x0a, 0x0d, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x61, 0x74, 0x63, 0x68, 0x66, 0x65, 0x74, 0x63, 0x68, - 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x46, 0x65, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0d, 0x74, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x5f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x12, 0x35, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x2c, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x20, 0x0a, - 0x03, 0x69, 0x73, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x69, 0x73, 0x73, - 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x69, 0x73, 0x73, 0x12, - 0x2c, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x12, 0x29, 0x0a, - 0x06, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, - 0x52, 0x06, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x12, 0x20, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, - 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x70, 0x70, 0x62, 0x2e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x61, 0x70, 0x70, 0x12, 0x32, 0x0a, 0x09, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3f, - 0x0a, 0x0e, 0x63, 0x68, 0x6b, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x68, 0x6b, 0x70, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, - 0x52, 0x0d, 0x63, 0x68, 0x6b, 0x70, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x42, 0x0a, 0x0f, 0x70, 0x70, 0x72, 0x65, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x61, 0x64, 0x74, - 0x6f, 0x72, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x70, 0x72, 0x65, 0x70, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x70, 0x72, 0x65, 0x70, 0x56, 0x61, 0x6c, 0x69, 0x61, 0x64, - 0x74, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x09, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6f, 0x6e, 0x67, - 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, - 0x6e, 0x67, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x70, 0x69, - 0x6e, 0x67, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x45, 0x0a, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0xad, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x41, 0x0a, - 0x0b, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x18, 0xae, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, - 0x12, 0x2b, 0x0a, 0x06, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0xaf, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, - 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, - 0x04, 0x6e, 0x65, 0x78, 0x74, 0x18, 0x90, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x04, 0x90, 0xa6, - 0x1d, 0x01, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x3a, 0x04, 0x88, 0xa6, 0x1d, 0x01, 0x42, 0x0c, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x0c, 0x0a, 0x04, - 0x49, 0x6e, 0x69, 0x74, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0xc6, 0x01, 0x0a, 0x0a, 0x54, - 0x69, 0x6d, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x48, 0x00, 0x52, - 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x2e, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x48, 0x00, 0x52, 0x06, - 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x12, 0x47, 0x0a, 0x0f, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, - 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x47, - 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, - 0x0e, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x3a, - 0x04, 0x90, 0xa6, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x04, 0x80, - 0xa6, 0x1d, 0x01, 0x22, 0x9e, 0x01, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x44, 0x65, 0x6c, - 0x61, 0x79, 0x12, 0x36, 0x0a, 0x0f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x5f, - 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x54, 0x6f, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x52, 0x0a, 0x05, 0x64, 0x65, - 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3c, 0x82, 0xa6, 0x1d, 0x38, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, - 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x3a, 0x04, - 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x90, 0x02, 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x52, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x12, 0x38, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x74, - 0x6f, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x54, 0x6f, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x12, 0x52, - 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3c, 0x82, - 0xa6, 0x1d, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, - 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, - 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x12, 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, - 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, - 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x54, 0x69, 0x6d, 0x65, - 0x72, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, - 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, - 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, - 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, - 0x98, 0xa6, 0x1d, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2f, 0x67, 0x72, + 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, + 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x0a, 0x0a, 0x05, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0x82, 0xa6, 0x1d, 0x32, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, + 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x49, 0x44, 0x52, 0x0a, 0x64, 0x65, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x23, + 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x69, + 0x6e, 0x69, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x72, + 0x12, 0x29, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x03, 0x62, + 0x63, 0x62, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x62, 0x63, 0x62, 0x70, 0x62, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x62, 0x63, 0x62, 0x12, 0x2c, 0x0a, + 0x07, 0x6d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x6d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x61, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x2d, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x64, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x64, 0x62, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, + 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, 0x62, 0x12, 0x3c, 0x0a, 0x0d, 0x62, 0x61, 0x74, 0x63, 0x68, + 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x62, 0x61, 0x74, 0x63, 0x68, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0d, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x5f, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x70, 0x62, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x43, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x12, 0x35, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x66, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x07, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x03, 0x69, 0x73, 0x73, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x69, 0x73, 0x73, 0x70, 0x62, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x69, 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x07, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x72, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x06, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x12, 0x20, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x70, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, + 0x52, 0x03, 0x61, 0x70, 0x70, 0x12, 0x32, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x63, 0x68, 0x6b, + 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x18, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x68, 0x6b, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x68, 0x6b, + 0x70, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x0f, 0x70, 0x70, + 0x72, 0x65, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x61, 0x64, 0x74, 0x6f, 0x72, 0x18, 0x19, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0e, + 0x70, 0x70, 0x72, 0x65, 0x70, 0x56, 0x61, 0x6c, 0x69, 0x61, 0x64, 0x74, 0x6f, 0x72, 0x12, 0x2c, + 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x09, + 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0xc8, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x70, 0x62, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x6e, 0x67, 0x12, + 0x45, 0x0a, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x18, 0xad, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x41, 0x0a, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x55, 0x69, 0x6e, 0x74, 0x18, 0xae, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, + 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x18, 0xaf, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x18, 0x90, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x04, 0x90, 0xa6, 0x1d, 0x01, 0x52, 0x04, 0x6e, 0x65, 0x78, + 0x74, 0x3a, 0x04, 0x88, 0xa6, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x0c, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x3a, 0x04, 0x98, + 0xa6, 0x1d, 0x01, 0x22, 0xc6, 0x01, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x72, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, + 0x2e, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x52, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x12, + 0x47, 0x0a, 0x0f, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x3a, 0x04, 0x90, 0xa6, 0x1d, 0x01, 0x42, 0x0c, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x9e, 0x01, 0x0a, + 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x36, 0x0a, 0x0f, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x54, 0x6f, 0x44, 0x65, + 0x6c, 0x61, 0x79, 0x12, 0x52, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x3c, 0x82, 0xa6, 0x1d, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x90, 0x02, + 0x0a, 0x0b, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x12, 0x38, 0x0a, + 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, + 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x54, + 0x6f, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x12, 0x52, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3c, 0x82, 0xa6, 0x1d, 0x38, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x6d, 0x0a, 0x0f, 0x72, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, + 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, + 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, + 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x42, 0x30, 0x5a, + 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, + 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -943,10 +963,11 @@ var file_eventpb_eventpb_proto_goTypes = []interface{}{ (*transportpb.Event)(nil), // 19: transportpb.Event (*chkpvalidatorpb.Event)(nil), // 20: chkpvalidatorpb.Event (*pprepvalidatorpb.Event)(nil), // 21: pprepvalidatorpb.Event - (*pingpongpb.Event)(nil), // 22: pingpongpb.Event - (*wrappers.StringValue)(nil), // 23: google.protobuf.StringValue - (*wrappers.UInt64Value)(nil), // 24: google.protobuf.UInt64Value - (*testerpb.Tester)(nil), // 25: testerpb.Tester + (*granitepb.Event)(nil), // 22: granitepb.Event + (*pingpongpb.Event)(nil), // 23: pingpongpb.Event + (*wrappers.StringValue)(nil), // 24: google.protobuf.StringValue + (*wrappers.UInt64Value)(nil), // 25: google.protobuf.UInt64Value + (*testerpb.Tester)(nil), // 26: testerpb.Tester } var file_eventpb_eventpb_proto_depIdxs = []int32{ 1, // 0: eventpb.Event.init:type_name -> eventpb.Init @@ -967,21 +988,22 @@ var file_eventpb_eventpb_proto_depIdxs = []int32{ 19, // 15: eventpb.Event.transport:type_name -> transportpb.Event 20, // 16: eventpb.Event.chkp_validator:type_name -> chkpvalidatorpb.Event 21, // 17: eventpb.Event.pprep_valiadtor:type_name -> pprepvalidatorpb.Event - 22, // 18: eventpb.Event.ping_pong:type_name -> pingpongpb.Event - 23, // 19: eventpb.Event.testingString:type_name -> google.protobuf.StringValue - 24, // 20: eventpb.Event.testingUint:type_name -> google.protobuf.UInt64Value - 25, // 21: eventpb.Event.tester:type_name -> testerpb.Tester - 0, // 22: eventpb.Event.next:type_name -> eventpb.Event - 3, // 23: eventpb.TimerEvent.delay:type_name -> eventpb.TimerDelay - 4, // 24: eventpb.TimerEvent.repeat:type_name -> eventpb.TimerRepeat - 5, // 25: eventpb.TimerEvent.garbage_collect:type_name -> eventpb.TimerGarbageCollect - 0, // 26: eventpb.TimerDelay.events_to_delay:type_name -> eventpb.Event - 0, // 27: eventpb.TimerRepeat.events_to_repeat:type_name -> eventpb.Event - 28, // [28:28] is the sub-list for method output_type - 28, // [28:28] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name + 22, // 18: eventpb.Event.granite:type_name -> granitepb.Event + 23, // 19: eventpb.Event.ping_pong:type_name -> pingpongpb.Event + 24, // 20: eventpb.Event.testingString:type_name -> google.protobuf.StringValue + 25, // 21: eventpb.Event.testingUint:type_name -> google.protobuf.UInt64Value + 26, // 22: eventpb.Event.tester:type_name -> testerpb.Tester + 0, // 23: eventpb.Event.next:type_name -> eventpb.Event + 3, // 24: eventpb.TimerEvent.delay:type_name -> eventpb.TimerDelay + 4, // 25: eventpb.TimerEvent.repeat:type_name -> eventpb.TimerRepeat + 5, // 26: eventpb.TimerEvent.garbage_collect:type_name -> eventpb.TimerGarbageCollect + 0, // 27: eventpb.TimerDelay.events_to_delay:type_name -> eventpb.Event + 0, // 28: eventpb.TimerRepeat.events_to_repeat:type_name -> eventpb.Event + 29, // [29:29] is the sub-list for method output_type + 29, // [29:29] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_eventpb_eventpb_proto_init() } @@ -1082,6 +1104,7 @@ func file_eventpb_eventpb_proto_init() { (*Event_Transport)(nil), (*Event_ChkpValidator)(nil), (*Event_PprepValiadtor)(nil), + (*Event_Granite)(nil), (*Event_PingPong)(nil), (*Event_TestingString)(nil), (*Event_TestingUint)(nil), diff --git a/pkg/pb/eventpb/eventpb.pb.mir.go b/pkg/pb/eventpb/eventpb.pb.mir.go index 8808e7d1a..f81e0bcc0 100644 --- a/pkg/pb/eventpb/eventpb.pb.mir.go +++ b/pkg/pb/eventpb/eventpb.pb.mir.go @@ -26,6 +26,7 @@ func (*Event) ReflectTypeOptions() []reflect.Type { reflect.TypeOf((*Event_Transport)(nil)), reflect.TypeOf((*Event_ChkpValidator)(nil)), reflect.TypeOf((*Event_PprepValiadtor)(nil)), + reflect.TypeOf((*Event_Granite)(nil)), reflect.TypeOf((*Event_PingPong)(nil)), reflect.TypeOf((*Event_TestingString)(nil)), reflect.TypeOf((*Event_TestingUint)(nil)), diff --git a/pkg/pb/eventpb/oneof_interfaces.mir.go b/pkg/pb/eventpb/oneof_interfaces.mir.go index 2baab82b9..e1f6c03ba 100644 --- a/pkg/pb/eventpb/oneof_interfaces.mir.go +++ b/pkg/pb/eventpb/oneof_interfaces.mir.go @@ -12,6 +12,7 @@ import ( chkpvalidatorpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb/chkpvalidatorpb" cryptopb "github.com/filecoin-project/mir/pkg/pb/cryptopb" factorypb "github.com/filecoin-project/mir/pkg/pb/factorypb" + granitepb "github.com/filecoin-project/mir/pkg/pb/granitepb" hasherpb "github.com/filecoin-project/mir/pkg/pb/hasherpb" isspb "github.com/filecoin-project/mir/pkg/pb/isspb" mempoolpb "github.com/filecoin-project/mir/pkg/pb/mempoolpb" @@ -103,6 +104,10 @@ func (w *Event_PprepValiadtor) Unwrap() *pprepvalidatorpb.Event { return w.PprepValiadtor } +func (w *Event_Granite) Unwrap() *granitepb.Event { + return w.Granite +} + func (w *Event_PingPong) Unwrap() *pingpongpb.Event { return w.PingPong } diff --git a/pkg/pb/eventpb/types/types.mir.go b/pkg/pb/eventpb/types/types.mir.go index 119300d27..8264d582e 100644 --- a/pkg/pb/eventpb/types/types.mir.go +++ b/pkg/pb/eventpb/types/types.mir.go @@ -4,7 +4,7 @@ package eventpbtypes import ( mirreflect "github.com/filecoin-project/mir/codegen/mirreflect" - types19 "github.com/filecoin-project/mir/codegen/model/types" + types20 "github.com/filecoin-project/mir/codegen/model/types" types13 "github.com/filecoin-project/mir/pkg/pb/apppb/types" types5 "github.com/filecoin-project/mir/pkg/pb/availabilitypb/batchdbpb/types" types4 "github.com/filecoin-project/mir/pkg/pb/availabilitypb/types" @@ -15,17 +15,18 @@ import ( types12 "github.com/filecoin-project/mir/pkg/pb/cryptopb/types" eventpb "github.com/filecoin-project/mir/pkg/pb/eventpb" types9 "github.com/filecoin-project/mir/pkg/pb/factorypb/types" + types17 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" types1 "github.com/filecoin-project/mir/pkg/pb/hasherpb/types" types10 "github.com/filecoin-project/mir/pkg/pb/isspb/types" types3 "github.com/filecoin-project/mir/pkg/pb/mempoolpb/types" types16 "github.com/filecoin-project/mir/pkg/pb/ordererpb/pprepvalidatorpb/types" types11 "github.com/filecoin-project/mir/pkg/pb/ordererpb/types" - types17 "github.com/filecoin-project/mir/pkg/pb/pingpongpb/types" - types18 "github.com/filecoin-project/mir/pkg/pb/testerpb/types" + types18 "github.com/filecoin-project/mir/pkg/pb/pingpongpb/types" + types19 "github.com/filecoin-project/mir/pkg/pb/testerpb/types" types7 "github.com/filecoin-project/mir/pkg/pb/threshcryptopb/types" types14 "github.com/filecoin-project/mir/pkg/pb/transportpb/types" - types20 "github.com/filecoin-project/mir/pkg/timer/types" - types21 "github.com/filecoin-project/mir/pkg/trantor/types" + types21 "github.com/filecoin-project/mir/pkg/timer/types" + types22 "github.com/filecoin-project/mir/pkg/trantor/types" types "github.com/filecoin-project/mir/pkg/types" reflectutil "github.com/filecoin-project/mir/pkg/util/reflectutil" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" @@ -89,14 +90,16 @@ func Event_TypeFromPb(pb eventpb.Event_Type) Event_Type { return &Event_ChkpValidator{ChkpValidator: types15.EventFromPb(pb.ChkpValidator)} case *eventpb.Event_PprepValiadtor: return &Event_PprepValiadtor{PprepValiadtor: types16.EventFromPb(pb.PprepValiadtor)} + case *eventpb.Event_Granite: + return &Event_Granite{Granite: types17.EventFromPb(pb.Granite)} case *eventpb.Event_PingPong: - return &Event_PingPong{PingPong: types17.EventFromPb(pb.PingPong)} + return &Event_PingPong{PingPong: types18.EventFromPb(pb.PingPong)} case *eventpb.Event_TestingString: return &Event_TestingString{TestingString: pb.TestingString} case *eventpb.Event_TestingUint: return &Event_TestingUint{TestingUint: pb.TestingUint} case *eventpb.Event_Tester: - return &Event_Tester{Tester: types18.TesterFromPb(pb.Tester)} + return &Event_Tester{Tester: types19.TesterFromPb(pb.Tester)} } return nil } @@ -533,13 +536,37 @@ func (*Event_PprepValiadtor) MirReflect() mirreflect.Type { return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*eventpb.Event_PprepValiadtor]()} } +type Event_Granite struct { + Granite *types17.Event +} + +func (*Event_Granite) isEvent_Type() {} + +func (w *Event_Granite) Unwrap() *types17.Event { + return w.Granite +} + +func (w *Event_Granite) Pb() eventpb.Event_Type { + if w == nil { + return nil + } + if w.Granite == nil { + return &eventpb.Event_Granite{} + } + return &eventpb.Event_Granite{Granite: (w.Granite).Pb()} +} + +func (*Event_Granite) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*eventpb.Event_Granite]()} +} + type Event_PingPong struct { - PingPong *types17.Event + PingPong *types18.Event } func (*Event_PingPong) isEvent_Type() {} -func (w *Event_PingPong) Unwrap() *types17.Event { +func (w *Event_PingPong) Unwrap() *types18.Event { return w.PingPong } @@ -606,12 +633,12 @@ func (*Event_TestingUint) MirReflect() mirreflect.Type { } type Event_Tester struct { - Tester *types18.Tester + Tester *types19.Tester } func (*Event_Tester) isEvent_Type() {} -func (w *Event_Tester) Unwrap() *types18.Tester { +func (w *Event_Tester) Unwrap() *types19.Tester { return w.Tester } @@ -636,7 +663,7 @@ func EventFromPb(pb *eventpb.Event) *Event { return &Event{ DestModule: (types.ModuleID)(pb.DestModule), Type: Event_TypeFromPb(pb.Type), - Next: types19.ConvertSlice(pb.Next, func(t *eventpb.Event) *Event { + Next: types20.ConvertSlice(pb.Next, func(t *eventpb.Event) *Event { return EventFromPb(t) }), } @@ -652,7 +679,7 @@ func (m *Event) Pb() *eventpb.Event { if m.Type != nil { pbMessage.Type = (m.Type).Pb() } - pbMessage.Next = types19.ConvertSlice(m.Next, func(t *Event) *eventpb.Event { + pbMessage.Next = types20.ConvertSlice(m.Next, func(t *Event) *eventpb.Event { return (t).Pb() }) } @@ -819,7 +846,7 @@ func (*TimerEvent) MirReflect() mirreflect.Type { type TimerDelay struct { EventsToDelay []*Event - Delay types20.Duration + Delay types21.Duration } func TimerDelayFromPb(pb *eventpb.TimerDelay) *TimerDelay { @@ -827,10 +854,10 @@ func TimerDelayFromPb(pb *eventpb.TimerDelay) *TimerDelay { return nil } return &TimerDelay{ - EventsToDelay: types19.ConvertSlice(pb.EventsToDelay, func(t *eventpb.Event) *Event { + EventsToDelay: types20.ConvertSlice(pb.EventsToDelay, func(t *eventpb.Event) *Event { return EventFromPb(t) }), - Delay: (types20.Duration)(pb.Delay), + Delay: (types21.Duration)(pb.Delay), } } @@ -840,7 +867,7 @@ func (m *TimerDelay) Pb() *eventpb.TimerDelay { } pbMessage := &eventpb.TimerDelay{} { - pbMessage.EventsToDelay = types19.ConvertSlice(m.EventsToDelay, func(t *Event) *eventpb.Event { + pbMessage.EventsToDelay = types20.ConvertSlice(m.EventsToDelay, func(t *Event) *eventpb.Event { return (t).Pb() }) pbMessage.Delay = (uint64)(m.Delay) @@ -855,8 +882,8 @@ func (*TimerDelay) MirReflect() mirreflect.Type { type TimerRepeat struct { EventsToRepeat []*Event - Delay types20.Duration - RetentionIndex types21.RetentionIndex + Delay types21.Duration + RetentionIndex types22.RetentionIndex } func TimerRepeatFromPb(pb *eventpb.TimerRepeat) *TimerRepeat { @@ -864,11 +891,11 @@ func TimerRepeatFromPb(pb *eventpb.TimerRepeat) *TimerRepeat { return nil } return &TimerRepeat{ - EventsToRepeat: types19.ConvertSlice(pb.EventsToRepeat, func(t *eventpb.Event) *Event { + EventsToRepeat: types20.ConvertSlice(pb.EventsToRepeat, func(t *eventpb.Event) *Event { return EventFromPb(t) }), - Delay: (types20.Duration)(pb.Delay), - RetentionIndex: (types21.RetentionIndex)(pb.RetentionIndex), + Delay: (types21.Duration)(pb.Delay), + RetentionIndex: (types22.RetentionIndex)(pb.RetentionIndex), } } @@ -878,7 +905,7 @@ func (m *TimerRepeat) Pb() *eventpb.TimerRepeat { } pbMessage := &eventpb.TimerRepeat{} { - pbMessage.EventsToRepeat = types19.ConvertSlice(m.EventsToRepeat, func(t *Event) *eventpb.Event { + pbMessage.EventsToRepeat = types20.ConvertSlice(m.EventsToRepeat, func(t *Event) *eventpb.Event { return (t).Pb() }) pbMessage.Delay = (uint64)(m.Delay) @@ -893,7 +920,7 @@ func (*TimerRepeat) MirReflect() mirreflect.Type { } type TimerGarbageCollect struct { - RetentionIndex types21.RetentionIndex + RetentionIndex types22.RetentionIndex } func TimerGarbageCollectFromPb(pb *eventpb.TimerGarbageCollect) *TimerGarbageCollect { @@ -901,7 +928,7 @@ func TimerGarbageCollectFromPb(pb *eventpb.TimerGarbageCollect) *TimerGarbageCol return nil } return &TimerGarbageCollect{ - RetentionIndex: (types21.RetentionIndex)(pb.RetentionIndex), + RetentionIndex: (types22.RetentionIndex)(pb.RetentionIndex), } } diff --git a/pkg/pb/granitepb/dsl/messages.mir.go b/pkg/pb/granitepb/dsl/messages.mir.go index 36145ed11..62bb74929 100644 --- a/pkg/pb/granitepb/dsl/messages.mir.go +++ b/pkg/pb/granitepb/dsl/messages.mir.go @@ -24,30 +24,6 @@ func UponMessageReceived[W types.Message_TypeWrapper[M], M any](m dsl.Module, ha }) } -func UponConvergeReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, ticket *types.Ticket, signature []uint8) error) { - UponMessageReceived[*types.Message_Converge](m, func(from types1.NodeID, msg *types.Converge) error { - return handler(from, msg.Round, msg.Data, msg.Ticket, msg.Signature) - }) -} - -func UponProposeReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, signature []uint8) error) { - UponMessageReceived[*types.Message_Propose](m, func(from types1.NodeID, msg *types.Propose) error { - return handler(from, msg.Round, msg.Data, msg.Signature) - }) -} - -func UponPrepareReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, signature []uint8) error) { - UponMessageReceived[*types.Message_Prepare](m, func(from types1.NodeID, msg *types.Prepare) error { - return handler(from, msg.Round, msg.Data, msg.Signature) - }) -} - -func UponCommitReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, signature []uint8) error) { - UponMessageReceived[*types.Message_Commit](m, func(from types1.NodeID, msg *types.Commit) error { - return handler(from, msg.Round, msg.Data, msg.Signature) - }) -} - func UponDecisionReceived(m dsl.Module, handler func(from types1.NodeID, data []uint8, signature []uint8) error) { UponMessageReceived[*types.Message_Decision](m, func(from types1.NodeID, msg *types.Decision) error { return handler(from, msg.Data, msg.Signature) diff --git a/pkg/pb/granitepb/granitepb.pb.go b/pkg/pb/granitepb/granitepb.pb.go index 9d49797df..d6ecba00d 100644 --- a/pkg/pb/granitepb/granitepb.pb.go +++ b/pkg/pb/granitepb/granitepb.pb.go @@ -29,10 +29,6 @@ type Message struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Type: - // *Message_Converge - // *Message_Propose - // *Message_Prepare - // *Message_Commit // *Message_Decision // *Message_ConsensusMsg Type isMessage_Type `protobuf_oneof:"type"` @@ -77,34 +73,6 @@ func (m *Message) GetType() isMessage_Type { return nil } -func (x *Message) GetConverge() *Converge { - if x, ok := x.GetType().(*Message_Converge); ok { - return x.Converge - } - return nil -} - -func (x *Message) GetPropose() *Propose { - if x, ok := x.GetType().(*Message_Propose); ok { - return x.Propose - } - return nil -} - -func (x *Message) GetPrepare() *Prepare { - if x, ok := x.GetType().(*Message_Prepare); ok { - return x.Prepare - } - return nil -} - -func (x *Message) GetCommit() *Commit { - if x, ok := x.GetType().(*Message_Commit); ok { - return x.Commit - } - return nil -} - func (x *Message) GetDecision() *Decision { if x, ok := x.GetType().(*Message_Decision); ok { return x.Decision @@ -123,23 +91,11 @@ type isMessage_Type interface { isMessage_Type() } -type Message_Converge struct { - Converge *Converge `protobuf:"bytes,1,opt,name=converge,proto3,oneof"` -} - -type Message_Propose struct { - Propose *Propose `protobuf:"bytes,2,opt,name=propose,proto3,oneof"` -} - -type Message_Prepare struct { - Prepare *Prepare `protobuf:"bytes,3,opt,name=prepare,proto3,oneof"` -} - -type Message_Commit struct { - Commit *Commit `protobuf:"bytes,4,opt,name=commit,proto3,oneof"` -} - type Message_Decision struct { + // Converge converge = 1; + // Propose propose = 2; + // Prepare prepare = 3; + // Commit commit = 4; Decision *Decision `protobuf:"bytes,5,opt,name=decision,proto3,oneof"` } @@ -147,32 +103,22 @@ type Message_ConsensusMsg struct { ConsensusMsg *ConsensusMsg `protobuf:"bytes,6,opt,name=consensus_msg,json=consensusMsg,proto3,oneof"` } -func (*Message_Converge) isMessage_Type() {} - -func (*Message_Propose) isMessage_Type() {} - -func (*Message_Prepare) isMessage_Type() {} - -func (*Message_Commit) isMessage_Type() {} - func (*Message_Decision) isMessage_Type() {} func (*Message_ConsensusMsg) isMessage_Type() {} -type ConsensusMsg struct { +type Event struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MsgType int32 `protobuf:"varint,1,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` - Round uint64 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Ticket *Ticket `protobuf:"bytes,4,opt,name=ticket,proto3" json:"ticket,omitempty"` - Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` + // Types that are assignable to Type: + // *Event_ConvergeTimeout + Type isEvent_Type `protobuf_oneof:"type"` } -func (x *ConsensusMsg) Reset() { - *x = ConsensusMsg{} +func (x *Event) Reset() { + *x = Event{} if protoimpl.UnsafeEnabled { mi := &file_granitepb_granitepb_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -180,13 +126,13 @@ func (x *ConsensusMsg) Reset() { } } -func (x *ConsensusMsg) String() string { +func (x *Event) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConsensusMsg) ProtoMessage() {} +func (*Event) ProtoMessage() {} -func (x *ConsensusMsg) ProtoReflect() protoreflect.Message { +func (x *Event) ProtoReflect() protoreflect.Message { mi := &file_granitepb_granitepb_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -198,59 +144,49 @@ func (x *ConsensusMsg) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConsensusMsg.ProtoReflect.Descriptor instead. -func (*ConsensusMsg) Descriptor() ([]byte, []int) { +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { return file_granitepb_granitepb_proto_rawDescGZIP(), []int{1} } -func (x *ConsensusMsg) GetMsgType() int32 { - if x != nil { - return x.MsgType - } - return 0 -} - -func (x *ConsensusMsg) GetRound() uint64 { - if x != nil { - return x.Round +func (m *Event) GetType() isEvent_Type { + if m != nil { + return m.Type } - return 0 + return nil } -func (x *ConsensusMsg) GetData() []byte { - if x != nil { - return x.Data +func (x *Event) GetConvergeTimeout() *ConvergeTimeout { + if x, ok := x.GetType().(*Event_ConvergeTimeout); ok { + return x.ConvergeTimeout } return nil } -func (x *ConsensusMsg) GetTicket() *Ticket { - if x != nil { - return x.Ticket - } - return nil +type isEvent_Type interface { + isEvent_Type() } -func (x *ConsensusMsg) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil +type Event_ConvergeTimeout struct { + ConvergeTimeout *ConvergeTimeout `protobuf:"bytes,1,opt,name=converge_timeout,json=convergeTimeout,proto3,oneof"` } -type Converge struct { +func (*Event_ConvergeTimeout) isEvent_Type() {} + +type ConsensusMsg struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Ticket *Ticket `protobuf:"bytes,3,opt,name=ticket,proto3" json:"ticket,omitempty"` - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` + MsgType int32 `protobuf:"varint,1,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` + Round uint64 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Ticket *Ticket `protobuf:"bytes,4,opt,name=ticket,proto3" json:"ticket,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` } -func (x *Converge) Reset() { - *x = Converge{} +func (x *ConsensusMsg) Reset() { + *x = ConsensusMsg{} if protoimpl.UnsafeEnabled { mi := &file_granitepb_granitepb_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -258,13 +194,13 @@ func (x *Converge) Reset() { } } -func (x *Converge) String() string { +func (x *ConsensusMsg) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Converge) ProtoMessage() {} +func (*ConsensusMsg) ProtoMessage() {} -func (x *Converge) ProtoReflect() protoreflect.Message { +func (x *ConsensusMsg) ProtoReflect() protoreflect.Message { mi := &file_granitepb_granitepb_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -276,39 +212,57 @@ func (x *Converge) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Converge.ProtoReflect.Descriptor instead. -func (*Converge) Descriptor() ([]byte, []int) { +// Deprecated: Use ConsensusMsg.ProtoReflect.Descriptor instead. +func (*ConsensusMsg) Descriptor() ([]byte, []int) { return file_granitepb_granitepb_proto_rawDescGZIP(), []int{2} } -func (x *Converge) GetRound() uint64 { +func (x *ConsensusMsg) GetMsgType() int32 { + if x != nil { + return x.MsgType + } + return 0 +} + +func (x *ConsensusMsg) GetRound() uint64 { if x != nil { return x.Round } return 0 } -func (x *Converge) GetData() []byte { +func (x *ConsensusMsg) GetData() []byte { if x != nil { return x.Data } return nil } -func (x *Converge) GetTicket() *Ticket { +func (x *ConsensusMsg) GetTicket() *Ticket { if x != nil { return x.Ticket } return nil } -func (x *Converge) GetSignature() []byte { +func (x *ConsensusMsg) GetSignature() []byte { if x != nil { return x.Signature } return nil } +// ATT: HERE BELOW THERE ARE SEPARATED DESCRIPTIONS OF EACH MESSAGE, BUT IN ORDER TO MINIMIZE MIR-DEPENDANT CODE I HAVE PUT THEM ALL IN ONE MESSAGE ABOVE. +// +//message Converge{ +// option (net.message) = true; +// +// uint64 round = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/granite/types.RoundNr"]; +// bytes data = 2; +// Ticket ticket = 3; +// bytes signature = 4; +//} +// type Ticket struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -356,18 +310,14 @@ func (x *Ticket) GetData() []byte { return nil } -type Propose struct { +type ConvergeTimeout struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` } -func (x *Propose) Reset() { - *x = Propose{} +func (x *ConvergeTimeout) Reset() { + *x = ConvergeTimeout{} if protoimpl.UnsafeEnabled { mi := &file_granitepb_granitepb_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -375,13 +325,13 @@ func (x *Propose) Reset() { } } -func (x *Propose) String() string { +func (x *ConvergeTimeout) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Propose) ProtoMessage() {} +func (*ConvergeTimeout) ProtoMessage() {} -func (x *Propose) ProtoReflect() protoreflect.Message { +func (x *ConvergeTimeout) ProtoReflect() protoreflect.Message { mi := &file_granitepb_granitepb_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -393,158 +343,11 @@ func (x *Propose) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Propose.ProtoReflect.Descriptor instead. -func (*Propose) Descriptor() ([]byte, []int) { +// Deprecated: Use ConvergeTimeout.ProtoReflect.Descriptor instead. +func (*ConvergeTimeout) Descriptor() ([]byte, []int) { return file_granitepb_granitepb_proto_rawDescGZIP(), []int{4} } -func (x *Propose) GetRound() uint64 { - if x != nil { - return x.Round - } - return 0 -} - -func (x *Propose) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *Propose) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type Prepare struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *Prepare) Reset() { - *x = Prepare{} - if protoimpl.UnsafeEnabled { - mi := &file_granitepb_granitepb_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Prepare) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Prepare) ProtoMessage() {} - -func (x *Prepare) ProtoReflect() protoreflect.Message { - mi := &file_granitepb_granitepb_proto_msgTypes[5] - 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 Prepare.ProtoReflect.Descriptor instead. -func (*Prepare) Descriptor() ([]byte, []int) { - return file_granitepb_granitepb_proto_rawDescGZIP(), []int{5} -} - -func (x *Prepare) GetRound() uint64 { - if x != nil { - return x.Round - } - return 0 -} - -func (x *Prepare) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *Prepare) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type Commit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *Commit) Reset() { - *x = Commit{} - if protoimpl.UnsafeEnabled { - mi := &file_granitepb_granitepb_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Commit) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Commit) ProtoMessage() {} - -func (x *Commit) ProtoReflect() protoreflect.Message { - mi := &file_granitepb_granitepb_proto_msgTypes[6] - 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 Commit.ProtoReflect.Descriptor instead. -func (*Commit) Descriptor() ([]byte, []int) { - return file_granitepb_granitepb_proto_rawDescGZIP(), []int{6} -} - -func (x *Commit) GetRound() uint64 { - if x != nil { - return x.Round - } - return 0 -} - -func (x *Commit) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *Commit) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - type Decision struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -557,7 +360,7 @@ type Decision struct { func (x *Decision) Reset() { *x = Decision{} if protoimpl.UnsafeEnabled { - mi := &file_granitepb_granitepb_proto_msgTypes[7] + mi := &file_granitepb_granitepb_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -570,7 +373,7 @@ func (x *Decision) String() string { func (*Decision) ProtoMessage() {} func (x *Decision) ProtoReflect() protoreflect.Message { - mi := &file_granitepb_granitepb_proto_msgTypes[7] + mi := &file_granitepb_granitepb_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -583,7 +386,7 @@ func (x *Decision) ProtoReflect() protoreflect.Message { // Deprecated: Use Decision.ProtoReflect.Descriptor instead. func (*Decision) Descriptor() ([]byte, []int) { - return file_granitepb_granitepb_proto_rawDescGZIP(), []int{7} + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{5} } func (x *Decision) GetData() []byte { @@ -612,7 +415,7 @@ type InstanceParams struct { func (x *InstanceParams) Reset() { *x = InstanceParams{} if protoimpl.UnsafeEnabled { - mi := &file_granitepb_granitepb_proto_msgTypes[8] + mi := &file_granitepb_granitepb_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -625,7 +428,7 @@ func (x *InstanceParams) String() string { func (*InstanceParams) ProtoMessage() {} func (x *InstanceParams) ProtoReflect() protoreflect.Message { - mi := &file_granitepb_granitepb_proto_msgTypes[8] + mi := &file_granitepb_granitepb_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -638,7 +441,7 @@ func (x *InstanceParams) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceParams.ProtoReflect.Descriptor instead. func (*InstanceParams) Descriptor() ([]byte, []int) { - return file_granitepb_granitepb_proto_rawDescGZIP(), []int{8} + return file_granitepb_granitepb_proto_rawDescGZIP(), []int{6} } func (x *InstanceParams) GetInstanceUid() uint64 { @@ -665,20 +468,8 @@ var file_granitepb_granitepb_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x02, - 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x08, 0x63, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, - 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, - 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x07, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, - 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, - 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, - 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x64, 0x65, 0x63, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x90, 0x01, + 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, @@ -687,68 +478,35 @@ var file_granitepb_granitepb_proto_rawDesc = []byte{ 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x3a, 0x04, 0xc8, 0xe4, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0xc8, 0xe4, 0x1d, 0x01, - 0x22, 0xa0, 0x02, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, - 0x67, 0x12, 0x58, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, - 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x53, 0x0a, 0x05, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, - 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, - 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, - 0xe4, 0x1d, 0x01, 0x22, 0xc2, 0x01, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, - 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, - 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, - 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x06, 0x74, 0x69, 0x63, - 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x61, 0x6e, - 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, 0x69, - 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x22, 0x0a, 0x06, 0x54, 0x69, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x96, 0x01, 0x0a, - 0x07, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, - 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, - 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, - 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x96, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x22, 0x64, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x10, 0x63, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, + 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, + 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x3a, 0x04, 0x90, 0xa6, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0xa0, 0x02, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, + 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, - 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x95, - 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, - 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, 0x72, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x42, 0x0a, 0x08, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x06, 0x74, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x61, + 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x74, + 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x22, 0x0a, 0x06, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x17, 0x0a, + 0x0f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x42, 0x0a, 0x08, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, @@ -778,34 +536,28 @@ func file_granitepb_granitepb_proto_rawDescGZIP() []byte { return file_granitepb_granitepb_proto_rawDescData } -var file_granitepb_granitepb_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_granitepb_granitepb_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_granitepb_granitepb_proto_goTypes = []interface{}{ (*Message)(nil), // 0: granitepb.Message - (*ConsensusMsg)(nil), // 1: granitepb.ConsensusMsg - (*Converge)(nil), // 2: granitepb.Converge + (*Event)(nil), // 1: granitepb.Event + (*ConsensusMsg)(nil), // 2: granitepb.ConsensusMsg (*Ticket)(nil), // 3: granitepb.Ticket - (*Propose)(nil), // 4: granitepb.Propose - (*Prepare)(nil), // 5: granitepb.Prepare - (*Commit)(nil), // 6: granitepb.Commit - (*Decision)(nil), // 7: granitepb.Decision - (*InstanceParams)(nil), // 8: granitepb.InstanceParams - (*trantorpb.Membership)(nil), // 9: trantorpb.Membership + (*ConvergeTimeout)(nil), // 4: granitepb.ConvergeTimeout + (*Decision)(nil), // 5: granitepb.Decision + (*InstanceParams)(nil), // 6: granitepb.InstanceParams + (*trantorpb.Membership)(nil), // 7: trantorpb.Membership } var file_granitepb_granitepb_proto_depIdxs = []int32{ - 2, // 0: granitepb.Message.converge:type_name -> granitepb.Converge - 4, // 1: granitepb.Message.propose:type_name -> granitepb.Propose - 5, // 2: granitepb.Message.prepare:type_name -> granitepb.Prepare - 6, // 3: granitepb.Message.commit:type_name -> granitepb.Commit - 7, // 4: granitepb.Message.decision:type_name -> granitepb.Decision - 1, // 5: granitepb.Message.consensus_msg:type_name -> granitepb.ConsensusMsg - 3, // 6: granitepb.ConsensusMsg.ticket:type_name -> granitepb.Ticket - 3, // 7: granitepb.Converge.ticket:type_name -> granitepb.Ticket - 9, // 8: granitepb.InstanceParams.membership:type_name -> trantorpb.Membership - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 5, // 0: granitepb.Message.decision:type_name -> granitepb.Decision + 2, // 1: granitepb.Message.consensus_msg:type_name -> granitepb.ConsensusMsg + 4, // 2: granitepb.Event.converge_timeout:type_name -> granitepb.ConvergeTimeout + 3, // 3: granitepb.ConsensusMsg.ticket:type_name -> granitepb.Ticket + 7, // 4: granitepb.InstanceParams.membership:type_name -> trantorpb.Membership + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] 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 } func init() { file_granitepb_granitepb_proto_init() } @@ -827,7 +579,7 @@ func file_granitepb_granitepb_proto_init() { } } file_granitepb_granitepb_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConsensusMsg); i { + switch v := v.(*Event); i { case 0: return &v.state case 1: @@ -839,7 +591,7 @@ func file_granitepb_granitepb_proto_init() { } } file_granitepb_granitepb_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Converge); i { + switch v := v.(*ConsensusMsg); i { case 0: return &v.state case 1: @@ -863,7 +615,7 @@ func file_granitepb_granitepb_proto_init() { } } file_granitepb_granitepb_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Propose); i { + switch v := v.(*ConvergeTimeout); i { case 0: return &v.state case 1: @@ -875,30 +627,6 @@ func file_granitepb_granitepb_proto_init() { } } file_granitepb_granitepb_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Prepare); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_granitepb_granitepb_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Commit); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_granitepb_granitepb_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Decision); i { case 0: return &v.state @@ -910,7 +638,7 @@ func file_granitepb_granitepb_proto_init() { return nil } } - file_granitepb_granitepb_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_granitepb_granitepb_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InstanceParams); i { case 0: return &v.state @@ -924,20 +652,19 @@ func file_granitepb_granitepb_proto_init() { } } file_granitepb_granitepb_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Message_Converge)(nil), - (*Message_Propose)(nil), - (*Message_Prepare)(nil), - (*Message_Commit)(nil), (*Message_Decision)(nil), (*Message_ConsensusMsg)(nil), } + file_granitepb_granitepb_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Event_ConvergeTimeout)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_granitepb_granitepb_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/pb/granitepb/granitepb.pb.mir.go b/pkg/pb/granitepb/granitepb.pb.mir.go index 1ed60e239..dcda3f428 100644 --- a/pkg/pb/granitepb/granitepb.pb.mir.go +++ b/pkg/pb/granitepb/granitepb.pb.mir.go @@ -8,11 +8,13 @@ import ( func (*Message) ReflectTypeOptions() []reflect.Type { return []reflect.Type{ - reflect.TypeOf((*Message_Converge)(nil)), - reflect.TypeOf((*Message_Propose)(nil)), - reflect.TypeOf((*Message_Prepare)(nil)), - reflect.TypeOf((*Message_Commit)(nil)), reflect.TypeOf((*Message_Decision)(nil)), reflect.TypeOf((*Message_ConsensusMsg)(nil)), } } + +func (*Event) ReflectTypeOptions() []reflect.Type { + return []reflect.Type{ + reflect.TypeOf((*Event_ConvergeTimeout)(nil)), + } +} diff --git a/pkg/pb/granitepb/msgs/msgs.mir.go b/pkg/pb/granitepb/msgs/msgs.mir.go index 0c63f868f..4ef1a9b1a 100644 --- a/pkg/pb/granitepb/msgs/msgs.mir.go +++ b/pkg/pb/granitepb/msgs/msgs.mir.go @@ -3,85 +3,16 @@ package granitepbmsgs import ( - types1 "github.com/filecoin-project/mir/pkg/granite/types" + types3 "github.com/filecoin-project/mir/pkg/granite/types" types2 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" - types3 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" + types1 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" types "github.com/filecoin-project/mir/pkg/types" ) -func Converge(destModule types.ModuleID, round types1.RoundNr, data []uint8, ticket *types2.Ticket, signature []uint8) *types3.Message { - return &types3.Message{ +func Decision(destModule types.ModuleID, data []uint8, signature []uint8) *types1.Message { + return &types1.Message{ DestModule: destModule, - Type: &types3.Message_Granite{ - Granite: &types2.Message{ - Type: &types2.Message_Converge{ - Converge: &types2.Converge{ - Round: round, - Data: data, - Ticket: ticket, - Signature: signature, - }, - }, - }, - }, - } -} - -func Propose(destModule types.ModuleID, round types1.RoundNr, data []uint8, signature []uint8) *types3.Message { - return &types3.Message{ - DestModule: destModule, - Type: &types3.Message_Granite{ - Granite: &types2.Message{ - Type: &types2.Message_Propose{ - Propose: &types2.Propose{ - Round: round, - Data: data, - Signature: signature, - }, - }, - }, - }, - } -} - -func Prepare(destModule types.ModuleID, round types1.RoundNr, data []uint8, signature []uint8) *types3.Message { - return &types3.Message{ - DestModule: destModule, - Type: &types3.Message_Granite{ - Granite: &types2.Message{ - Type: &types2.Message_Prepare{ - Prepare: &types2.Prepare{ - Round: round, - Data: data, - Signature: signature, - }, - }, - }, - }, - } -} - -func Commit(destModule types.ModuleID, round types1.RoundNr, data []uint8, signature []uint8) *types3.Message { - return &types3.Message{ - DestModule: destModule, - Type: &types3.Message_Granite{ - Granite: &types2.Message{ - Type: &types2.Message_Commit{ - Commit: &types2.Commit{ - Round: round, - Data: data, - Signature: signature, - }, - }, - }, - }, - } -} - -func Decision(destModule types.ModuleID, data []uint8, signature []uint8) *types3.Message { - return &types3.Message{ - DestModule: destModule, - Type: &types3.Message_Granite{ + Type: &types1.Message_Granite{ Granite: &types2.Message{ Type: &types2.Message_Decision{ Decision: &types2.Decision{ @@ -94,10 +25,10 @@ func Decision(destModule types.ModuleID, data []uint8, signature []uint8) *types } } -func ConsensusMsg(destModule types.ModuleID, msgType types1.MsgType, round types1.RoundNr, data []uint8, ticket *types2.Ticket, signature []uint8) *types3.Message { - return &types3.Message{ +func ConsensusMsg(destModule types.ModuleID, msgType types3.MsgType, round types3.RoundNr, data []uint8, ticket *types2.Ticket, signature []uint8) *types1.Message { + return &types1.Message{ DestModule: destModule, - Type: &types3.Message_Granite{ + Type: &types1.Message_Granite{ Granite: &types2.Message{ Type: &types2.Message_ConsensusMsg{ ConsensusMsg: &types2.ConsensusMsg{ diff --git a/pkg/pb/granitepb/oneof_interfaces.mir.go b/pkg/pb/granitepb/oneof_interfaces.mir.go index 62ae7ffbe..3a79a3764 100644 --- a/pkg/pb/granitepb/oneof_interfaces.mir.go +++ b/pkg/pb/granitepb/oneof_interfaces.mir.go @@ -9,26 +9,21 @@ type Message_TypeWrapper[T any] interface { Unwrap() *T } -func (w *Message_Converge) Unwrap() *Converge { - return w.Converge -} - -func (w *Message_Propose) Unwrap() *Propose { - return w.Propose +func (w *Message_Decision) Unwrap() *Decision { + return w.Decision } -func (w *Message_Prepare) Unwrap() *Prepare { - return w.Prepare +func (w *Message_ConsensusMsg) Unwrap() *ConsensusMsg { + return w.ConsensusMsg } -func (w *Message_Commit) Unwrap() *Commit { - return w.Commit -} +type Event_Type = isEvent_Type -func (w *Message_Decision) Unwrap() *Decision { - return w.Decision +type Event_TypeWrapper[T any] interface { + Event_Type + Unwrap() *T } -func (w *Message_ConsensusMsg) Unwrap() *ConsensusMsg { - return w.ConsensusMsg +func (w *Event_ConvergeTimeout) Unwrap() *ConvergeTimeout { + return w.ConvergeTimeout } diff --git a/pkg/pb/granitepb/types/types.mir.go b/pkg/pb/granitepb/types/types.mir.go index fc5e6a434..6ffd5a0f6 100644 --- a/pkg/pb/granitepb/types/types.mir.go +++ b/pkg/pb/granitepb/types/types.mir.go @@ -30,14 +30,6 @@ func Message_TypeFromPb(pb granitepb.Message_Type) Message_Type { return nil } switch pb := pb.(type) { - case *granitepb.Message_Converge: - return &Message_Converge{Converge: ConvergeFromPb(pb.Converge)} - case *granitepb.Message_Propose: - return &Message_Propose{Propose: ProposeFromPb(pb.Propose)} - case *granitepb.Message_Prepare: - return &Message_Prepare{Prepare: PrepareFromPb(pb.Prepare)} - case *granitepb.Message_Commit: - return &Message_Commit{Commit: CommitFromPb(pb.Commit)} case *granitepb.Message_Decision: return &Message_Decision{Decision: DecisionFromPb(pb.Decision)} case *granitepb.Message_ConsensusMsg: @@ -46,102 +38,6 @@ func Message_TypeFromPb(pb granitepb.Message_Type) Message_Type { return nil } -type Message_Converge struct { - Converge *Converge -} - -func (*Message_Converge) isMessage_Type() {} - -func (w *Message_Converge) Unwrap() *Converge { - return w.Converge -} - -func (w *Message_Converge) Pb() granitepb.Message_Type { - if w == nil { - return nil - } - if w.Converge == nil { - return &granitepb.Message_Converge{} - } - return &granitepb.Message_Converge{Converge: (w.Converge).Pb()} -} - -func (*Message_Converge) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Converge]()} -} - -type Message_Propose struct { - Propose *Propose -} - -func (*Message_Propose) isMessage_Type() {} - -func (w *Message_Propose) Unwrap() *Propose { - return w.Propose -} - -func (w *Message_Propose) Pb() granitepb.Message_Type { - if w == nil { - return nil - } - if w.Propose == nil { - return &granitepb.Message_Propose{} - } - return &granitepb.Message_Propose{Propose: (w.Propose).Pb()} -} - -func (*Message_Propose) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Propose]()} -} - -type Message_Prepare struct { - Prepare *Prepare -} - -func (*Message_Prepare) isMessage_Type() {} - -func (w *Message_Prepare) Unwrap() *Prepare { - return w.Prepare -} - -func (w *Message_Prepare) Pb() granitepb.Message_Type { - if w == nil { - return nil - } - if w.Prepare == nil { - return &granitepb.Message_Prepare{} - } - return &granitepb.Message_Prepare{Prepare: (w.Prepare).Pb()} -} - -func (*Message_Prepare) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Prepare]()} -} - -type Message_Commit struct { - Commit *Commit -} - -func (*Message_Commit) isMessage_Type() {} - -func (w *Message_Commit) Unwrap() *Commit { - return w.Commit -} - -func (w *Message_Commit) Pb() granitepb.Message_Type { - if w == nil { - return nil - } - if w.Commit == nil { - return &granitepb.Message_Commit{} - } - return &granitepb.Message_Commit{Commit: (w.Commit).Pb()} -} - -func (*Message_Commit) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message_Commit]()} -} - type Message_Decision struct { Decision *Decision } @@ -217,221 +113,177 @@ func (*Message) MirReflect() mirreflect.Type { return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Message]()} } -type ConsensusMsg struct { - MsgType types.MsgType - Round types.RoundNr - Data []uint8 - Ticket *Ticket - Signature []uint8 +type Event struct { + Type Event_Type } -func ConsensusMsgFromPb(pb *granitepb.ConsensusMsg) *ConsensusMsg { - if pb == nil { - return nil - } - return &ConsensusMsg{ - MsgType: (types.MsgType)(pb.MsgType), - Round: (types.RoundNr)(pb.Round), - Data: pb.Data, - Ticket: TicketFromPb(pb.Ticket), - Signature: pb.Signature, - } +type Event_Type interface { + mirreflect.GeneratedType + isEvent_Type() + Pb() granitepb.Event_Type } -func (m *ConsensusMsg) Pb() *granitepb.ConsensusMsg { - if m == nil { +type Event_TypeWrapper[T any] interface { + Event_Type + Unwrap() *T +} + +func Event_TypeFromPb(pb granitepb.Event_Type) Event_Type { + if pb == nil { return nil } - pbMessage := &granitepb.ConsensusMsg{} - { - pbMessage.MsgType = (int32)(m.MsgType) - pbMessage.Round = (uint64)(m.Round) - pbMessage.Data = m.Data - if m.Ticket != nil { - pbMessage.Ticket = (m.Ticket).Pb() - } - pbMessage.Signature = m.Signature + switch pb := pb.(type) { + case *granitepb.Event_ConvergeTimeout: + return &Event_ConvergeTimeout{ConvergeTimeout: ConvergeTimeoutFromPb(pb.ConvergeTimeout)} } - - return pbMessage + return nil } -func (*ConsensusMsg) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.ConsensusMsg]()} +type Event_ConvergeTimeout struct { + ConvergeTimeout *ConvergeTimeout } -type Converge struct { - Round types.RoundNr - Data []uint8 - Ticket *Ticket - Signature []uint8 -} +func (*Event_ConvergeTimeout) isEvent_Type() {} -func ConvergeFromPb(pb *granitepb.Converge) *Converge { - if pb == nil { - return nil - } - return &Converge{ - Round: (types.RoundNr)(pb.Round), - Data: pb.Data, - Ticket: TicketFromPb(pb.Ticket), - Signature: pb.Signature, - } +func (w *Event_ConvergeTimeout) Unwrap() *ConvergeTimeout { + return w.ConvergeTimeout } -func (m *Converge) Pb() *granitepb.Converge { - if m == nil { +func (w *Event_ConvergeTimeout) Pb() granitepb.Event_Type { + if w == nil { return nil } - pbMessage := &granitepb.Converge{} - { - pbMessage.Round = (uint64)(m.Round) - pbMessage.Data = m.Data - if m.Ticket != nil { - pbMessage.Ticket = (m.Ticket).Pb() - } - pbMessage.Signature = m.Signature + if w.ConvergeTimeout == nil { + return &granitepb.Event_ConvergeTimeout{} } - - return pbMessage + return &granitepb.Event_ConvergeTimeout{ConvergeTimeout: (w.ConvergeTimeout).Pb()} } -func (*Converge) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Converge]()} +func (*Event_ConvergeTimeout) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Event_ConvergeTimeout]()} } -type Ticket struct { - Data []uint8 -} - -func TicketFromPb(pb *granitepb.Ticket) *Ticket { +func EventFromPb(pb *granitepb.Event) *Event { if pb == nil { return nil } - return &Ticket{ - Data: pb.Data, + return &Event{ + Type: Event_TypeFromPb(pb.Type), } } -func (m *Ticket) Pb() *granitepb.Ticket { +func (m *Event) Pb() *granitepb.Event { if m == nil { return nil } - pbMessage := &granitepb.Ticket{} + pbMessage := &granitepb.Event{} { - pbMessage.Data = m.Data + if m.Type != nil { + pbMessage.Type = (m.Type).Pb() + } } return pbMessage } -func (*Ticket) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Ticket]()} +func (*Event) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Event]()} } -type Propose struct { +type ConsensusMsg struct { + MsgType types.MsgType Round types.RoundNr Data []uint8 + Ticket *Ticket Signature []uint8 } -func ProposeFromPb(pb *granitepb.Propose) *Propose { +func ConsensusMsgFromPb(pb *granitepb.ConsensusMsg) *ConsensusMsg { if pb == nil { return nil } - return &Propose{ + return &ConsensusMsg{ + MsgType: (types.MsgType)(pb.MsgType), Round: (types.RoundNr)(pb.Round), Data: pb.Data, + Ticket: TicketFromPb(pb.Ticket), Signature: pb.Signature, } } -func (m *Propose) Pb() *granitepb.Propose { +func (m *ConsensusMsg) Pb() *granitepb.ConsensusMsg { if m == nil { return nil } - pbMessage := &granitepb.Propose{} + pbMessage := &granitepb.ConsensusMsg{} { + pbMessage.MsgType = (int32)(m.MsgType) pbMessage.Round = (uint64)(m.Round) pbMessage.Data = m.Data + if m.Ticket != nil { + pbMessage.Ticket = (m.Ticket).Pb() + } pbMessage.Signature = m.Signature } return pbMessage } -func (*Propose) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Propose]()} +func (*ConsensusMsg) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.ConsensusMsg]()} } -type Prepare struct { - Round types.RoundNr - Data []uint8 - Signature []uint8 +type Ticket struct { + Data []uint8 } -func PrepareFromPb(pb *granitepb.Prepare) *Prepare { +func TicketFromPb(pb *granitepb.Ticket) *Ticket { if pb == nil { return nil } - return &Prepare{ - Round: (types.RoundNr)(pb.Round), - Data: pb.Data, - Signature: pb.Signature, + return &Ticket{ + Data: pb.Data, } } -func (m *Prepare) Pb() *granitepb.Prepare { +func (m *Ticket) Pb() *granitepb.Ticket { if m == nil { return nil } - pbMessage := &granitepb.Prepare{} + pbMessage := &granitepb.Ticket{} { - pbMessage.Round = (uint64)(m.Round) pbMessage.Data = m.Data - pbMessage.Signature = m.Signature } return pbMessage } -func (*Prepare) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Prepare]()} +func (*Ticket) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Ticket]()} } -type Commit struct { - Round types.RoundNr - Data []uint8 - Signature []uint8 -} +type ConvergeTimeout struct{} -func CommitFromPb(pb *granitepb.Commit) *Commit { +func ConvergeTimeoutFromPb(pb *granitepb.ConvergeTimeout) *ConvergeTimeout { if pb == nil { return nil } - return &Commit{ - Round: (types.RoundNr)(pb.Round), - Data: pb.Data, - Signature: pb.Signature, - } + return &ConvergeTimeout{} } -func (m *Commit) Pb() *granitepb.Commit { +func (m *ConvergeTimeout) Pb() *granitepb.ConvergeTimeout { if m == nil { return nil } - pbMessage := &granitepb.Commit{} + pbMessage := &granitepb.ConvergeTimeout{} { - pbMessage.Round = (uint64)(m.Round) - pbMessage.Data = m.Data - pbMessage.Signature = m.Signature } return pbMessage } -func (*Commit) MirReflect() mirreflect.Type { - return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.Commit]()} +func (*ConvergeTimeout) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*granitepb.ConvergeTimeout]()} } type Decision struct { diff --git a/protos/eventpb/eventpb.proto b/protos/eventpb/eventpb.proto index 7e71e0fdf..f4821781d 100644 --- a/protos/eventpb/eventpb.proto +++ b/protos/eventpb/eventpb.proto @@ -24,6 +24,9 @@ import "cryptopb/cryptopb.proto"; import "transportpb/transportpb.proto"; import "testerpb/testerpb.proto"; +import "granitepb/granitepb.proto"; + + import "mir/codegen_extensions.proto"; // Event represents a state event to be injected into the state machine @@ -58,6 +61,8 @@ message Event { transportpb.Event transport = 23; chkpvalidatorpb.Event chkp_validator = 24; pprepvalidatorpb.Event pprep_valiadtor = 25; + granitepb.Event granite = 26; + // Events for code samples diff --git a/protos/granitepb/granitepb.proto b/protos/granitepb/granitepb.proto index b7621aaf5..f5e0c77ce 100644 --- a/protos/granitepb/granitepb.proto +++ b/protos/granitepb/granitepb.proto @@ -15,12 +15,20 @@ message Message { oneof type { option (net.message_type) = true; - Converge converge = 1; - Propose propose = 2; - Prepare prepare = 3; - Commit commit = 4; - Decision decision = 5; - ConsensusMsg consensus_msg = 6; +// Converge converge = 1; +// Propose propose = 2; +// Prepare prepare = 3; +// Commit commit = 4; + Decision decision = 5; + ConsensusMsg consensus_msg = 6; + } +} + +message Event{ + option (mir.event_class) = true; + oneof type{ + option (mir.event_type) = true; + ConvergeTimeout converge_timeout = 1; } } @@ -47,6 +55,11 @@ message Ticket { option (mir.struct) = true; bytes data = 1; // TODO include actual ticket based on VRF proofs } + +message ConvergeTimeout{ + option (mir.event) = true; +} + // //message Propose { // option (net.message) = true; From 9c95ad995fbb9fc81b31e14a732db878ce3ef81b Mon Sep 17 00:00:00 2001 From: Alejandro Ranchal-Pedrosa Date: Sun, 10 Sep 2023 21:05:59 +0200 Subject: [PATCH 5/6] Implement message validation logic --- pkg/granite/common/common.go | 59 +++++++++++-- pkg/granite/granite.go | 2 +- .../parts/consensustask/consensustask.go | 86 ++++++++++++++----- .../messagehandlertask/messagehandlertask.go | 16 ++-- pkg/pb/granitepb/dsl/emit.mir.go | 15 ++++ pkg/pb/granitepb/dsl/messages.mir.go | 4 +- pkg/pb/granitepb/dsl/upon.mir.go | 28 ++++++ pkg/pb/granitepb/events/events.mir.go | 22 +++++ pkg/pb/granitepb/granitepb.pb.go | 49 +++++++---- pkg/pb/granitepb/msgs/msgs.mir.go | 31 +++---- pkg/pb/granitepb/types/types.mir.go | 3 + pkg/util/maputil/maputil.go | 46 ++++++++++ 12 files changed, 292 insertions(+), 69 deletions(-) create mode 100644 pkg/pb/granitepb/dsl/emit.mir.go create mode 100644 pkg/pb/granitepb/dsl/upon.mir.go create mode 100644 pkg/pb/granitepb/events/events.mir.go diff --git a/pkg/granite/common/common.go b/pkg/granite/common/common.go index dcec0f09d..515a738b8 100644 --- a/pkg/granite/common/common.go +++ b/pkg/granite/common/common.go @@ -3,9 +3,13 @@ package common import ( "github.com/filecoin-project/mir/pkg/crypto" "github.com/filecoin-project/mir/pkg/granite" + "github.com/filecoin-project/mir/pkg/granite/internal/parts/consensustask" granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types" trantorpbtypes "github.com/filecoin-project/mir/pkg/pb/trantorpb/types" t "github.com/filecoin-project/mir/pkg/types" + "github.com/filecoin-project/mir/pkg/util/maputil" + "github.com/filecoin-project/mir/pkg/util/membutil" + "reflect" "time" ) @@ -50,19 +54,62 @@ type State struct { Proposal []byte Value []byte + + Finished bool } -func (st *State) IsValid(msg *granitepbtypes.ConsensusMsg) bool { - //TODO implement message validation logic (algorithm 5 currently in Overleaf's doc) - return true +func (st *State) IsValid(msg *granitepbtypes.ConsensusMsg, params *ModuleParams) bool { + switch msg.MsgType { + case granite.CONVERGE: + //TODO verify ticket and return false if not verified + + if msg.Round == 1 { + return true + } else if value, ok := consensustask.GetValueWithStrongQuorum(params.Membership, st.ValidatedMsgs.Msgs[granite.COMMIT][granite.RoundNr(uint64(msg.Round)-1)]); ok && value == nil { + return true + } else { + return maputil.FindAny(st.ValidatedMsgs.Msgs[granite.COMMIT][granite.RoundNr(uint64(msg.Round)-1)], func(_msg *granitepbtypes.ConsensusMsg) bool { + return reflect.DeepEqual(_msg.Data, msg.Data) + }) + } + + case granite.PROPOSE: + if msg.Round == 1 { + return true + } else { + return maputil.FindAny(st.ValidatedMsgs.Msgs[granite.CONVERGE][msg.Round], func(_msg *granitepbtypes.ConsensusMsg) bool { + return reflect.DeepEqual(_msg.Data, msg.Data) + }) + } + + case granite.PREPARE: + keysWithVal := maputil.FindKeysWithFunc(st.ValidatedMsgs.Msgs[granite.PROPOSE][msg.Round], func(_msg *granitepbtypes.ConsensusMsg) bool { + return reflect.DeepEqual(_msg.Data, msg.Data) + }) + return membutil.HaveWeakQuorum(params.Membership, keysWithVal) + + case granite.COMMIT: + if msg.Data != nil { + keysWithVal := maputil.FindKeysWithFunc(st.ValidatedMsgs.Msgs[granite.PREPARE][msg.Round], func(_msg *granitepbtypes.ConsensusMsg) bool { + return reflect.DeepEqual(_msg.Data, msg.Data) + }) + return membutil.HaveStrongQuorum(params.Membership, keysWithVal) + } else { + return maputil.HasTwoDistinctValues(st.ValidatedMsgs.Msgs[granite.PREPARE][msg.Round], func(msg, _msg *granitepbtypes.ConsensusMsg) bool { + return reflect.DeepEqual(_msg.Data, msg.Data) + }) + } + } + + return false } -// TODO this can be optimized -func (st *State) FindNewValid() (*granitepbtypes.ConsensusMsg, t.NodeID, bool) { +// TODO this (and also other functions in message validation etc.) can be optimized +func (st *State) FindNewValid(params *ModuleParams) (*granitepbtypes.ConsensusMsg, t.NodeID, bool) { for _, store := range st.UnvalidatedMsgs.Msgs { for _, nodeMap := range store { for source, value := range nodeMap { - if st.IsValid(value) { + if st.IsValid(value, params) { return value, source, true } } diff --git a/pkg/granite/granite.go b/pkg/granite/granite.go index 141d28ba1..f7d6e448e 100644 --- a/pkg/granite/granite.go +++ b/pkg/granite/granite.go @@ -25,7 +25,7 @@ func NewModule(mc *ModuleConfig, params *ModuleParams, logger logging.Logger) (m m := dsl.NewModule(mc.Self) state := &common.State{ - Round: 0, + Round: 1, Step: PROPOSE, // First round skip CONVERGE step ValidatedMsgs: NewMsgStore(), UnvalidatedMsgs: NewMsgStore(), diff --git a/pkg/granite/internal/parts/consensustask/consensustask.go b/pkg/granite/internal/parts/consensustask/consensustask.go index 81411e58f..a2ef228d5 100644 --- a/pkg/granite/internal/parts/consensustask/consensustask.go +++ b/pkg/granite/internal/parts/consensustask/consensustask.go @@ -37,7 +37,7 @@ func IncludeConsensusTask( state.Value = state.Proposal var signature []byte - signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes(), []byte(int32(granite.PROPOSE))}) if err != nil { return err @@ -60,14 +60,13 @@ func IncludeConsensusTask( }) } -// TODO Actually implement this function with the core logic of Granite func MsgValidated(m dsl.Module, state *common.State, params *common.ModuleParams, mc *common.ModuleConfig, from types.NodeID, msg *granitepbtypes.ConsensusMsg) { - //TODO implement discarding messages for old rounds and buffering msgs for new rounds + //TODO implement discarding messages for old rounds and buffering msgs for new rounds? (perhaps just the fact that we call check[NextStep] at the end of a step when it finishes will suffice switch msg.MsgType { case granite.CONVERGE: @@ -128,12 +127,18 @@ func checkConverge( mc *common.ModuleConfig, ) error { state.Value = getValueMinimumTicket(params.Membership, state.ValidatedMsgs.Msgs[granite.CONVERGE][state.Round]) + + var signature []byte + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes(), []byte(int32(granite.PROPOSE))}) + if err != nil { + return err + } transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.ConsensusMsg(mc.Self, granite.PROPOSE, state.Round, state.Proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) state.Step = granite.PROPOSE //It could be that we have already received enough PREPARE messages to move to the next step - checkPropose( + return checkPropose( m, state, params, @@ -173,14 +178,14 @@ func checkPropose( mode := findMode( sliceutil.Transform( - maputil.GetValues(state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]), func(msg *granitepbtypes.ConsensusMsg) string { + maputil.GetValues(state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]), func(i int, msg *granitepbtypes.ConsensusMsg) string { return string(msg.Data) }), ) state.Value = []byte(mode) var signature []byte - signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes(), []byte(int32(granite.PREPARE))}) if err != nil { return err } @@ -235,14 +240,14 @@ func checkPrepare( return nil } - updatedValue := getValueWithQuorum(params.Membership, state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) + updatedValue, ok := GetValueWithStrongQuorum(params.Membership, state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) state.Value = nil - if updatedValue != nil { + if ok { state.Value = updatedValue } var signature []byte - signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes(), []byte(int32(granite.PREPARE))}) if err != nil { return err } @@ -268,6 +273,17 @@ func CommitValidated(m dsl.Module, mc *common.ModuleConfig, round granite.RoundNr, ) error { + + if value, ok := GetValueWithStrongQuorum(params.Membership, state.ValidatedMsgs.Msgs[granite.COMMIT][round]); ok { + decide( + m, + state, + mc, + params, + value, + ) + } + if round != state.Round { return nil } @@ -297,10 +313,16 @@ func checkCommit( return nil } - state.Value = getValueWithQuorum(params.Membership, state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) - if state.Value != nil { + updatedValue, ok := GetValueWithStrongQuorum(params.Membership, state.ValidatedMsgs.Msgs[granite.PROPOSE][state.Round]) + state.Value = updatedValue + if ok { //FINISHED - decide(...) + decide(m, + state, + mc, + params, + state.Value, + ) return nil } @@ -309,7 +331,7 @@ func checkCommit( state.Step = granite.CONVERGE var signature []byte - signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes()}) + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, state.Round.Bytes(), []byte(int32(granite.CONVERGE))}) if err != nil { return err } @@ -328,6 +350,26 @@ func checkCommit( return nil } +func decide(m dsl.Module, + state *common.State, + mc *common.ModuleConfig, + params *common.ModuleParams, + value []byte, +) error { + state.Value = value + state.Finished = true //TODO use this value where relevant (for correctness? and as an optimization perhaps too) + var signature []byte + signature, err := params.Crypto.Sign([][]byte{state.Value, params.InstanceUID, []byte("DECISION")}) + if err != nil { + return err + } + + //TODO Send to clients, not just Membership + // This code does not even use decide messages received to decide anything, but COMMITs received + transportpbdsl.SendMessage(m, mc.Net, granitepbmsgs.Decision(mc.Self, state.Proposal, nil, signature), maputil.GetKeys(params.Membership.Nodes)) + return nil +} + // ------------------ Helper functions ------------------ func findMode[T comparable](dataList []T) T { @@ -352,9 +394,13 @@ func findMode[T comparable](dataList []T) T { return modeData } -// getValueWithQuorum returns a value if it gathers at least a strong quorum. -// If no value has a strong quorum, it returns the default value. -func getValueWithQuorum(membership *trantorpbtypes.Membership, messages map[types.NodeID]*granitepbtypes.ConsensusMsg) []byte { +// GetValueWithStrongQuorum returns a value if it gathers at least a strong quorum. +// If no value has a strong quorum, it returns the default value and false. +func GetValueWithStrongQuorum(membership *trantorpbtypes.Membership, messages map[types.NodeID]*granitepbtypes.ConsensusMsg) ([]byte, bool) { + return getValueWithQuorum(membership, messages, membutil.HaveStrongQuorum) +} + +func getValueWithQuorum(membership *trantorpbtypes.Membership, messages map[types.NodeID]*granitepbtypes.ConsensusMsg, quorumFunc func(*trantorpbtypes.Membership, []types.NodeID) bool) ([]byte, bool) { // Store the occurrence counts of each string value and the nodes that vouched for it valueNodes := make(map[string][]types.NodeID) @@ -370,13 +416,13 @@ func getValueWithQuorum(membership *trantorpbtypes.Membership, messages map[type // Check each string value to see if it meets the strong quorum requirement for data, _ := range valueNodes { - if membutil.HaveStrongQuorum(membership, valueNodes[data]) { - return []byte(data) + if quorumFunc(membership, valueNodes[data]) { + return []byte(data), true } } // If no value met the requirement, return the default value - return nil + return nil, false } // getValue returns one of the non-empty values at random. @@ -405,4 +451,4 @@ func getValue(messages []*granitepbtypes.ConsensusMsg) []byte { func getValueMinimumTicket(membership *trantorpbtypes.Membership, messages map[types.NodeID]*granitepbtypes.ConsensusMsg) []byte { //TODO implement (return nil if empty, although at least local value should be part of set) return nil -} \ No newline at end of file +} diff --git a/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go b/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go index 8f8c24cbc..1a29b4613 100644 --- a/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go +++ b/pkg/granite/internal/parts/messagehandlertask/messagehandlertask.go @@ -21,12 +21,6 @@ func IncludeMessageHandlerTask( ) { granitepbdsl.UponConsensusMsgReceived(m, func(from types.NodeID, msgType granite.MsgType, round granite.RoundNr, data []uint8, ticket *granitepbtypes.Ticket, signature []uint8) error { - if _, ok := state.UnvalidatedMsgs.Get(msgType, round, from); ok { - return nil // message already received or duplicate, discarding - } else if _, ok := state.ValidatedMsgs.Get(msgType, round, from); ok { - return nil // message already received or duplicate, discarding - } - //Verify signature toVerify := [][]byte{data, params.InstanceUID, round.Bytes()} if msgType == granite.CONVERGE { @@ -52,9 +46,17 @@ func IncludeMessageHandlerTask( Signature: signature, } + // TODO If libp2p does not already implement it, relay messages here to a constant number of processes (e.g. 30) at random (epidemic dissemination) + + if _, ok := state.UnvalidatedMsgs.Get(msgType, round, from); ok { + return nil // message already received or duplicate, discarding + } else if _, ok := state.ValidatedMsgs.Get(msgType, round, from); ok { + return nil // message already received or duplicate, discarding + } + state.UnvalidatedMsgs.StoreMessage(msgType, round, from, msg) - for msg, source, ok := state.FindNewValid(); ok; msg, source, ok = state.FindNewValid() { + for msg, source, ok := state.FindNewValid(params); ok; msg, source, ok = state.FindNewValid(params) { state.UnvalidatedMsgs.RemoveMessage(msgType, round, from) state.ValidatedMsgs.StoreMessage(msgType, round, from, msg) diff --git a/pkg/pb/granitepb/dsl/emit.mir.go b/pkg/pb/granitepb/dsl/emit.mir.go new file mode 100644 index 000000000..46fdb173d --- /dev/null +++ b/pkg/pb/granitepb/dsl/emit.mir.go @@ -0,0 +1,15 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepbdsl + +import ( + dsl "github.com/filecoin-project/mir/pkg/dsl" + events "github.com/filecoin-project/mir/pkg/pb/granitepb/events" + types "github.com/filecoin-project/mir/pkg/types" +) + +// Module-specific dsl functions for emitting events. + +func ConvergeTimeout(m dsl.Module, destModule types.ModuleID) { + dsl.EmitMirEvent(m, events.ConvergeTimeout(destModule)) +} diff --git a/pkg/pb/granitepb/dsl/messages.mir.go b/pkg/pb/granitepb/dsl/messages.mir.go index 62bb74929..12afa5e58 100644 --- a/pkg/pb/granitepb/dsl/messages.mir.go +++ b/pkg/pb/granitepb/dsl/messages.mir.go @@ -24,9 +24,9 @@ func UponMessageReceived[W types.Message_TypeWrapper[M], M any](m dsl.Module, ha }) } -func UponDecisionReceived(m dsl.Module, handler func(from types1.NodeID, data []uint8, signature []uint8) error) { +func UponDecisionReceived(m dsl.Module, handler func(from types1.NodeID, round types3.RoundNr, data []uint8, signature []uint8) error) { UponMessageReceived[*types.Message_Decision](m, func(from types1.NodeID, msg *types.Decision) error { - return handler(from, msg.Data, msg.Signature) + return handler(from, msg.Round, msg.Data, msg.Signature) }) } diff --git a/pkg/pb/granitepb/dsl/upon.mir.go b/pkg/pb/granitepb/dsl/upon.mir.go new file mode 100644 index 000000000..63f5c231c --- /dev/null +++ b/pkg/pb/granitepb/dsl/upon.mir.go @@ -0,0 +1,28 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepbdsl + +import ( + dsl "github.com/filecoin-project/mir/pkg/dsl" + types1 "github.com/filecoin-project/mir/pkg/pb/eventpb/types" + types "github.com/filecoin-project/mir/pkg/pb/granitepb/types" +) + +// Module-specific dsl functions for processing events. + +func UponEvent[W types.Event_TypeWrapper[Ev], Ev any](m dsl.Module, handler func(ev *Ev) error) { + dsl.UponMirEvent[*types1.Event_Granite](m, func(ev *types.Event) error { + w, ok := ev.Type.(W) + if !ok { + return nil + } + + return handler(w.Unwrap()) + }) +} + +func UponConvergeTimeout(m dsl.Module, handler func() error) { + UponEvent[*types.Event_ConvergeTimeout](m, func(ev *types.ConvergeTimeout) error { + return handler() + }) +} diff --git a/pkg/pb/granitepb/events/events.mir.go b/pkg/pb/granitepb/events/events.mir.go new file mode 100644 index 000000000..e41c90852 --- /dev/null +++ b/pkg/pb/granitepb/events/events.mir.go @@ -0,0 +1,22 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package granitepbevents + +import ( + types1 "github.com/filecoin-project/mir/pkg/pb/eventpb/types" + types2 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + types "github.com/filecoin-project/mir/pkg/types" +) + +func ConvergeTimeout(destModule types.ModuleID) *types1.Event { + return &types1.Event{ + DestModule: destModule, + Type: &types1.Event_Granite{ + Granite: &types2.Event{ + Type: &types2.Event_ConvergeTimeout{ + ConvergeTimeout: &types2.ConvergeTimeout{}, + }, + }, + }, + } +} diff --git a/pkg/pb/granitepb/granitepb.pb.go b/pkg/pb/granitepb/granitepb.pb.go index d6ecba00d..fb9e00692 100644 --- a/pkg/pb/granitepb/granitepb.pb.go +++ b/pkg/pb/granitepb/granitepb.pb.go @@ -353,8 +353,9 @@ type Decision struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + Round uint64 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` } func (x *Decision) Reset() { @@ -389,6 +390,13 @@ func (*Decision) Descriptor() ([]byte, []int) { return file_granitepb_granitepb_proto_rawDescGZIP(), []int{5} } +func (x *Decision) GetRound() uint64 { + if x != nil { + return x.Round + } + return 0 +} + func (x *Decision) GetData() []byte { if x != nil { return x.Data @@ -506,22 +514,27 @@ var file_granitepb_granitepb_proto_rawDesc = []byte{ 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x17, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x42, 0x0a, 0x08, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0x70, 0x0a, 0x0e, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x69, 0x64, 0x12, - 0x35, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, - 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x97, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x63, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x53, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x3d, 0x82, 0xa6, 0x1d, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x61, 0x6e, + 0x69, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4e, + 0x72, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, + 0x22, 0x70, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x55, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x68, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x72, 0x61, 0x6e, + 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, + 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x3a, 0x04, 0x80, 0xa6, + 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, + 0x6e, 0x69, 0x74, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/pb/granitepb/msgs/msgs.mir.go b/pkg/pb/granitepb/msgs/msgs.mir.go index 4ef1a9b1a..e0bf6be08 100644 --- a/pkg/pb/granitepb/msgs/msgs.mir.go +++ b/pkg/pb/granitepb/msgs/msgs.mir.go @@ -3,19 +3,20 @@ package granitepbmsgs import ( - types3 "github.com/filecoin-project/mir/pkg/granite/types" - types2 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" - types1 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" + types1 "github.com/filecoin-project/mir/pkg/granite/types" + types3 "github.com/filecoin-project/mir/pkg/pb/granitepb/types" + types2 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" types "github.com/filecoin-project/mir/pkg/types" ) -func Decision(destModule types.ModuleID, data []uint8, signature []uint8) *types1.Message { - return &types1.Message{ +func Decision(destModule types.ModuleID, round types1.RoundNr, data []uint8, signature []uint8) *types2.Message { + return &types2.Message{ DestModule: destModule, - Type: &types1.Message_Granite{ - Granite: &types2.Message{ - Type: &types2.Message_Decision{ - Decision: &types2.Decision{ + Type: &types2.Message_Granite{ + Granite: &types3.Message{ + Type: &types3.Message_Decision{ + Decision: &types3.Decision{ + Round: round, Data: data, Signature: signature, }, @@ -25,13 +26,13 @@ func Decision(destModule types.ModuleID, data []uint8, signature []uint8) *types } } -func ConsensusMsg(destModule types.ModuleID, msgType types3.MsgType, round types3.RoundNr, data []uint8, ticket *types2.Ticket, signature []uint8) *types1.Message { - return &types1.Message{ +func ConsensusMsg(destModule types.ModuleID, msgType types1.MsgType, round types1.RoundNr, data []uint8, ticket *types3.Ticket, signature []uint8) *types2.Message { + return &types2.Message{ DestModule: destModule, - Type: &types1.Message_Granite{ - Granite: &types2.Message{ - Type: &types2.Message_ConsensusMsg{ - ConsensusMsg: &types2.ConsensusMsg{ + Type: &types2.Message_Granite{ + Granite: &types3.Message{ + Type: &types3.Message_ConsensusMsg{ + ConsensusMsg: &types3.ConsensusMsg{ MsgType: msgType, Round: round, Data: data, diff --git a/pkg/pb/granitepb/types/types.mir.go b/pkg/pb/granitepb/types/types.mir.go index 6ffd5a0f6..e631f9c8a 100644 --- a/pkg/pb/granitepb/types/types.mir.go +++ b/pkg/pb/granitepb/types/types.mir.go @@ -287,6 +287,7 @@ func (*ConvergeTimeout) MirReflect() mirreflect.Type { } type Decision struct { + Round types.RoundNr Data []uint8 Signature []uint8 } @@ -296,6 +297,7 @@ func DecisionFromPb(pb *granitepb.Decision) *Decision { return nil } return &Decision{ + Round: (types.RoundNr)(pb.Round), Data: pb.Data, Signature: pb.Signature, } @@ -307,6 +309,7 @@ func (m *Decision) Pb() *granitepb.Decision { } pbMessage := &granitepb.Decision{} { + pbMessage.Round = (uint64)(m.Round) pbMessage.Data = m.Data pbMessage.Signature = m.Signature } diff --git a/pkg/util/maputil/maputil.go b/pkg/util/maputil/maputil.go index 731975b78..3fb34eb72 100644 --- a/pkg/util/maputil/maputil.go +++ b/pkg/util/maputil/maputil.go @@ -164,3 +164,49 @@ func RemoveAll[K comparable, V any](m map[K]V, f func(key K, value V) bool) map[ } return removed } + +// FindAny checks if there exists any value in the provided map that satisfies +// the given predicate function. +func FindAny[K comparable, V any](m map[K]V, predicate func(V) bool) bool { + for _, value := range m { + if predicate(value) { + return true + } + } + return false +} + +// FindKeysWithFunc searches the map for keys whose associated value evals to true with the given evalFunc. +// It then returns the list of keys to the evalFunc. +func FindKeysWithFunc[K comparable, V any](m map[K]V, evalFunc func(V) bool) []K { + var matchingKeys []K + + for key, value := range m { + if evalFunc(value) { + matchingKeys = append(matchingKeys, key) + } + } + + return matchingKeys +} + +// HasTwoDistinctValues checks if a map has at least two distinct values, based on a given comparison function. +func HasTwoDistinctValues[K comparable, V any](m map[K]V, isEqual func(V, V) bool) bool { + if len(m) < 2 { + return false + } + + var firstValue V + var hasFirstValueBeenSet bool = false + + for _, value := range m { + if !hasFirstValueBeenSet { + firstValue = value + hasFirstValueBeenSet = true + } else if !isEqual(firstValue, value) { + return true + } + } + + return false +} From 35116ea7f45ab8845f3fd6010de481294e4093e9 Mon Sep 17 00:00:00 2001 From: Alejandro Ranchal-Pedrosa Date: Mon, 11 Sep 2023 11:26:07 +0200 Subject: [PATCH 6/6] Leave placeholder to implement isModeOfAnySubset (with weights) when validating PREPARE msgs --- pkg/granite/common/common.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/granite/common/common.go b/pkg/granite/common/common.go index 515a738b8..dce480772 100644 --- a/pkg/granite/common/common.go +++ b/pkg/granite/common/common.go @@ -83,10 +83,9 @@ func (st *State) IsValid(msg *granitepbtypes.ConsensusMsg, params *ModuleParams) } case granite.PREPARE: - keysWithVal := maputil.FindKeysWithFunc(st.ValidatedMsgs.Msgs[granite.PROPOSE][msg.Round], func(_msg *granitepbtypes.ConsensusMsg) bool { - return reflect.DeepEqual(_msg.Data, msg.Data) - }) - return membutil.HaveWeakQuorum(params.Membership, keysWithVal) + //TODO COMPUTE whether the value is a mode for some subset efficiently (subsets with key's weights from membership) + // What is the most efficient way? + return true case granite.COMMIT: if msg.Data != nil {