diff --git a/Makefile b/Makefile index f43f91a3..089022ba 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ VERSION ?= $(shell git describe --tags) GOLANGCI_LINT_VERSION := v1.52.0 STATICCHECK_VERSION := v0.4.3 GOTESTSUM_VERSION := v1.9.0 -GOSCALE_VERSION := v1.1.1 +GOSCALE_VERSION := v1.1.6 BUF_VERSION := 1.8.0 PROTOC_VERSION = 21.8 @@ -51,6 +51,8 @@ GOTESTSUM := $(GOBIN)/gotestsum GOVULNCHECK := $(GOBIN)/govulncheck GOLINES := $(GOBIN)/golines +FUZZTIME ?= "10s" + $(GOVULNCHECK): @go install golang.org/x/vuln/cmd/govulncheck@latest @@ -182,3 +184,7 @@ test-generate: @make generate @git diff --name-only --diff-filter=AM --exit-code . || { echo "\nPlease rerun 'make generate' and commit changes.\n"; exit 1; } .PHONY: test-generate + +fuzz: + ./scripts/fuzz.sh $(FUZZTIME) +.PHONY: fuzz diff --git a/go.mod b/go.mod index f556b5df..13a08537 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/nullstyle/go-xdr v0.0.0-20180726165426-f4c839f75077 github.com/prometheus/client_golang v1.14.0 github.com/spacemeshos/api/release/go v1.5.6 - github.com/spacemeshos/go-scale v1.1.4 + github.com/spacemeshos/go-scale v1.1.6 github.com/spacemeshos/merkle-tree v0.2.1 github.com/spacemeshos/sha256-simd v0.1.0 github.com/stretchr/testify v1.8.2 diff --git a/go.sum b/go.sum index 5a62e449..645ebdd2 100644 --- a/go.sum +++ b/go.sum @@ -124,8 +124,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spacemeshos/api/release/go v1.5.6 h1:ubcUppvafyRLyq+yvOzXS3u7//rxEkJ85kmcOQWQwUc= github.com/spacemeshos/api/release/go v1.5.6/go.mod h1:4EIC5bex4jpz6RbP3i1KhacBLn+2g5xGA4Rw1JfYfZI= -github.com/spacemeshos/go-scale v1.1.4 h1:lvUUTX5ujFSkJ1If9CYCBegQI3q/qAZGPb+lYI+9wUM= -github.com/spacemeshos/go-scale v1.1.4/go.mod h1:bZscMRJOaT9TpwaqU+ca/8GmMw71KC1CIfcSPSihiT0= +github.com/spacemeshos/go-scale v1.1.6 h1:gieW5CvgoBbJTlqk5vGAu9t4NdHQcgfEL8qtJFo6BQ0= +github.com/spacemeshos/go-scale v1.1.6/go.mod h1:AxKr+yCe5qn7EsM5ZAygGdulxVVfU+Fe2bc4PsnNakM= github.com/spacemeshos/merkle-tree v0.2.1 h1:BSs/zt1n3ceZcpWdcqNFRvTeAWDlc0W+bql0XQH/Gz4= github.com/spacemeshos/merkle-tree v0.2.1/go.mod h1:IsrdlW6AHZ4HSi89H7G94ravFCMFZLGnm6To0tQ0SPY= github.com/spacemeshos/sha256-simd v0.1.0 h1:G7Mfu5RYdQiuE+wu4ZyJ7I0TI74uqLhFnKblEnSpjYI= diff --git a/release/proto/go/rpc/api/v1/api.pb.go b/release/proto/go/rpc/api/v1/api.pb.go index a306a413..234cb6a0 100644 --- a/release/proto/go/rpc/api/v1/api.pb.go +++ b/release/proto/go/rpc/api/v1/api.pb.go @@ -326,14 +326,14 @@ func (x *SubmitResponse) GetRoundEnd() *durationpb.Duration { return nil } -type GetInfoRequest struct { +type InfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *GetInfoRequest) Reset() { - *x = GetInfoRequest{} +func (x *InfoRequest) Reset() { + *x = InfoRequest{} if protoimpl.UnsafeEnabled { mi := &file_rpc_api_v1_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -341,13 +341,13 @@ func (x *GetInfoRequest) Reset() { } } -func (x *GetInfoRequest) String() string { +func (x *InfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetInfoRequest) ProtoMessage() {} +func (*InfoRequest) ProtoMessage() {} -func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { +func (x *InfoRequest) ProtoReflect() protoreflect.Message { mi := &file_rpc_api_v1_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -359,12 +359,12 @@ func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetInfoRequest.ProtoReflect.Descriptor instead. -func (*GetInfoRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead. +func (*InfoRequest) Descriptor() ([]byte, []int) { return file_rpc_api_v1_api_proto_rawDescGZIP(), []int{6} } -type GetInfoResponse struct { +type InfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -374,8 +374,8 @@ type GetInfoResponse struct { ServicePubkey []byte `protobuf:"bytes,3,opt,name=service_pubkey,json=servicePubkey,proto3" json:"service_pubkey,omitempty"` } -func (x *GetInfoResponse) Reset() { - *x = GetInfoResponse{} +func (x *InfoResponse) Reset() { + *x = InfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_rpc_api_v1_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -383,13 +383,13 @@ func (x *GetInfoResponse) Reset() { } } -func (x *GetInfoResponse) String() string { +func (x *InfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetInfoResponse) ProtoMessage() {} +func (*InfoResponse) ProtoMessage() {} -func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { +func (x *InfoResponse) ProtoReflect() protoreflect.Message { mi := &file_rpc_api_v1_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -401,26 +401,26 @@ func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetInfoResponse.ProtoReflect.Descriptor instead. -func (*GetInfoResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead. +func (*InfoResponse) Descriptor() ([]byte, []int) { return file_rpc_api_v1_api_proto_rawDescGZIP(), []int{7} } -func (x *GetInfoResponse) GetOpenRoundId() string { +func (x *InfoResponse) GetOpenRoundId() string { if x != nil { return x.OpenRoundId } return "" } -func (x *GetInfoResponse) GetExecutingRoundsIds() []string { +func (x *InfoResponse) GetExecutingRoundsIds() []string { if x != nil { return x.ExecutingRoundsIds } return nil } -func (x *GetInfoResponse) GetServicePubkey() []byte { +func (x *InfoResponse) GetServicePubkey() []byte { if x != nil { return x.ServicePubkey } @@ -616,7 +616,7 @@ func (x *PoetProof) GetLeaves() uint64 { return 0 } -type GetProofRequest struct { +type ProofRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -624,8 +624,8 @@ type GetProofRequest struct { RoundId string `protobuf:"bytes,1,opt,name=round_id,json=roundId,proto3" json:"round_id,omitempty"` } -func (x *GetProofRequest) Reset() { - *x = GetProofRequest{} +func (x *ProofRequest) Reset() { + *x = ProofRequest{} if protoimpl.UnsafeEnabled { mi := &file_rpc_api_v1_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -633,13 +633,13 @@ func (x *GetProofRequest) Reset() { } } -func (x *GetProofRequest) String() string { +func (x *ProofRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetProofRequest) ProtoMessage() {} +func (*ProofRequest) ProtoMessage() {} -func (x *GetProofRequest) ProtoReflect() protoreflect.Message { +func (x *ProofRequest) ProtoReflect() protoreflect.Message { mi := &file_rpc_api_v1_api_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -651,19 +651,19 @@ func (x *GetProofRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetProofRequest.ProtoReflect.Descriptor instead. -func (*GetProofRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use ProofRequest.ProtoReflect.Descriptor instead. +func (*ProofRequest) Descriptor() ([]byte, []int) { return file_rpc_api_v1_api_proto_rawDescGZIP(), []int{11} } -func (x *GetProofRequest) GetRoundId() string { +func (x *ProofRequest) GetRoundId() string { if x != nil { return x.RoundId } return "" } -type GetProofResponse struct { +type ProofResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -672,8 +672,8 @@ type GetProofResponse struct { Pubkey []byte `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"` } -func (x *GetProofResponse) Reset() { - *x = GetProofResponse{} +func (x *ProofResponse) Reset() { + *x = ProofResponse{} if protoimpl.UnsafeEnabled { mi := &file_rpc_api_v1_api_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -681,13 +681,13 @@ func (x *GetProofResponse) Reset() { } } -func (x *GetProofResponse) String() string { +func (x *ProofResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetProofResponse) ProtoMessage() {} +func (*ProofResponse) ProtoMessage() {} -func (x *GetProofResponse) ProtoReflect() protoreflect.Message { +func (x *ProofResponse) ProtoReflect() protoreflect.Message { mi := &file_rpc_api_v1_api_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -699,19 +699,19 @@ func (x *GetProofResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetProofResponse.ProtoReflect.Descriptor instead. -func (*GetProofResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ProofResponse.ProtoReflect.Descriptor instead. +func (*ProofResponse) Descriptor() ([]byte, []int) { return file_rpc_api_v1_api_proto_rawDescGZIP(), []int{12} } -func (x *GetProofResponse) GetProof() *PoetProof { +func (x *ProofResponse) GetProof() *PoetProof { if x != nil { return x.Proof } return nil } -func (x *GetProofResponse) GetPubkey() []byte { +func (x *ProofResponse) GetPubkey() []byte { if x != nil { return x.Pubkey } @@ -756,85 +756,84 @@ var file_rpc_api_v1_api_proto_rawDesc = []byte{ 0x75, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, - 0x6e, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x6e, - 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x49, 0x64, 0x73, 0x12, 0x25, - 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, - 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0x51, 0x0a, 0x0f, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x68, 0x69, 0x70, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x6f, - 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x67, 0x0a, 0x0b, 0x4d, 0x65, 0x72, 0x6b, - 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, - 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, - 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4e, 0x6f, 0x64, 0x65, - 0x73, 0x22, 0x6c, 0x0a, 0x09, 0x50, 0x6f, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, - 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, - 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x22, - 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x57, 0x0a, - 0x10, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, - 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x16, - 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, - 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x32, 0xe9, 0x03, 0x0a, 0x0b, 0x50, 0x6f, 0x65, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x76, - 0x31, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x72, 0x0a, 0x0d, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x20, 0x2e, 0x72, 0x70, - 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x56, - 0x0a, 0x06, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x22, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, - 0x6d, 0x69, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x54, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, - 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x64, 0x0a, 0x08, - 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x2f, 0x7b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, - 0x64, 0x7d, 0x42, 0xa3, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x70, 0x6f, 0x65, 0x74, 0x2f, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, - 0x72, 0x70, 0x63, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x0a, 0x52, 0x70, 0x63, 0x2e, 0x41, 0x70, 0x69, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x52, 0x70, 0x63, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x16, 0x52, 0x70, 0x63, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x52, 0x70, 0x63, 0x3a, - 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x64, 0x22, 0x0d, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x8b, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x52, + 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, + 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x49, 0x64, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, + 0x51, 0x0a, 0x0f, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x22, 0x67, 0x0a, 0x0b, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x5f, + 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, + 0x6f, 0x76, 0x65, 0x6e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x0a, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x09, 0x50, + 0x6f, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x22, 0x29, 0x0a, 0x0c, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x75, + 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x6f, 0x75, + 0x6e, 0x64, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x6f, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x32, 0xd7, 0x03, 0x0a, 0x0b, 0x50, + 0x6f, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x05, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, + 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, + 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x72, + 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, + 0x20, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x3a, + 0x01, 0x2a, 0x12, 0x56, 0x0a, 0x06, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x72, + 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x22, 0x0a, 0x2f, 0x76, 0x31, + 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x4b, 0x0a, 0x04, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, + 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x5b, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x2f, 0x7b, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xa3, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x70, 0x6f, 0x65, 0x74, + 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x0a, 0x52, 0x70, 0x63, 0x2e, 0x41, + 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x52, 0x70, 0x63, 0x5c, 0x41, 0x70, 0x69, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x16, 0x52, 0x70, 0x63, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x52, 0x70, + 0x63, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -857,29 +856,29 @@ var file_rpc_api_v1_api_proto_goTypes = []interface{}{ (*UpdateGatewayResponse)(nil), // 3: rpc.api.v1.UpdateGatewayResponse (*SubmitRequest)(nil), // 4: rpc.api.v1.SubmitRequest (*SubmitResponse)(nil), // 5: rpc.api.v1.SubmitResponse - (*GetInfoRequest)(nil), // 6: rpc.api.v1.GetInfoRequest - (*GetInfoResponse)(nil), // 7: rpc.api.v1.GetInfoResponse + (*InfoRequest)(nil), // 6: rpc.api.v1.InfoRequest + (*InfoResponse)(nil), // 7: rpc.api.v1.InfoResponse (*MembershipProof)(nil), // 8: rpc.api.v1.MembershipProof (*MerkleProof)(nil), // 9: rpc.api.v1.MerkleProof (*PoetProof)(nil), // 10: rpc.api.v1.PoetProof - (*GetProofRequest)(nil), // 11: rpc.api.v1.GetProofRequest - (*GetProofResponse)(nil), // 12: rpc.api.v1.GetProofResponse + (*ProofRequest)(nil), // 11: rpc.api.v1.ProofRequest + (*ProofResponse)(nil), // 12: rpc.api.v1.ProofResponse (*durationpb.Duration)(nil), // 13: google.protobuf.Duration } var file_rpc_api_v1_api_proto_depIdxs = []int32{ 13, // 0: rpc.api.v1.SubmitResponse.round_end:type_name -> google.protobuf.Duration 9, // 1: rpc.api.v1.PoetProof.proof:type_name -> rpc.api.v1.MerkleProof - 10, // 2: rpc.api.v1.GetProofResponse.proof:type_name -> rpc.api.v1.PoetProof + 10, // 2: rpc.api.v1.ProofResponse.proof:type_name -> rpc.api.v1.PoetProof 0, // 3: rpc.api.v1.PoetService.Start:input_type -> rpc.api.v1.StartRequest 2, // 4: rpc.api.v1.PoetService.UpdateGateway:input_type -> rpc.api.v1.UpdateGatewayRequest 4, // 5: rpc.api.v1.PoetService.Submit:input_type -> rpc.api.v1.SubmitRequest - 6, // 6: rpc.api.v1.PoetService.GetInfo:input_type -> rpc.api.v1.GetInfoRequest - 11, // 7: rpc.api.v1.PoetService.GetProof:input_type -> rpc.api.v1.GetProofRequest + 6, // 6: rpc.api.v1.PoetService.Info:input_type -> rpc.api.v1.InfoRequest + 11, // 7: rpc.api.v1.PoetService.Proof:input_type -> rpc.api.v1.ProofRequest 1, // 8: rpc.api.v1.PoetService.Start:output_type -> rpc.api.v1.StartResponse 3, // 9: rpc.api.v1.PoetService.UpdateGateway:output_type -> rpc.api.v1.UpdateGatewayResponse 5, // 10: rpc.api.v1.PoetService.Submit:output_type -> rpc.api.v1.SubmitResponse - 7, // 11: rpc.api.v1.PoetService.GetInfo:output_type -> rpc.api.v1.GetInfoResponse - 12, // 12: rpc.api.v1.PoetService.GetProof:output_type -> rpc.api.v1.GetProofResponse + 7, // 11: rpc.api.v1.PoetService.Info:output_type -> rpc.api.v1.InfoResponse + 12, // 12: rpc.api.v1.PoetService.Proof:output_type -> rpc.api.v1.ProofResponse 8, // [8:13] is the sub-list for method output_type 3, // [3:8] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -966,7 +965,7 @@ func file_rpc_api_v1_api_proto_init() { } } file_rpc_api_v1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetInfoRequest); i { + switch v := v.(*InfoRequest); i { case 0: return &v.state case 1: @@ -978,7 +977,7 @@ func file_rpc_api_v1_api_proto_init() { } } file_rpc_api_v1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetInfoResponse); i { + switch v := v.(*InfoResponse); i { case 0: return &v.state case 1: @@ -1026,7 +1025,7 @@ func file_rpc_api_v1_api_proto_init() { } } file_rpc_api_v1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProofRequest); i { + switch v := v.(*ProofRequest); i { case 0: return &v.state case 1: @@ -1038,7 +1037,7 @@ func file_rpc_api_v1_api_proto_init() { } } file_rpc_api_v1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProofResponse); i { + switch v := v.(*ProofResponse); i { case 0: return &v.state case 1: diff --git a/release/proto/go/rpc/api/v1/api.pb.gw.go b/release/proto/go/rpc/api/v1/api.pb.gw.go index 075e228d..f3b21f61 100644 --- a/release/proto/go/rpc/api/v1/api.pb.gw.go +++ b/release/proto/go/rpc/api/v1/api.pb.gw.go @@ -133,26 +133,26 @@ func local_request_PoetService_Submit_0(ctx context.Context, marshaler runtime.M } -func request_PoetService_GetInfo_0(ctx context.Context, marshaler runtime.Marshaler, client PoetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetInfoRequest +func request_PoetService_Info_0(ctx context.Context, marshaler runtime.Marshaler, client PoetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq InfoRequest var metadata runtime.ServerMetadata - msg, err := client.GetInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Info(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_PoetService_GetInfo_0(ctx context.Context, marshaler runtime.Marshaler, server PoetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetInfoRequest +func local_request_PoetService_Info_0(ctx context.Context, marshaler runtime.Marshaler, server PoetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq InfoRequest var metadata runtime.ServerMetadata - msg, err := server.GetInfo(ctx, &protoReq) + msg, err := server.Info(ctx, &protoReq) return msg, metadata, err } -func request_PoetService_GetProof_0(ctx context.Context, marshaler runtime.Marshaler, client PoetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetProofRequest +func request_PoetService_Proof_0(ctx context.Context, marshaler runtime.Marshaler, client PoetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ProofRequest var metadata runtime.ServerMetadata var ( @@ -172,13 +172,13 @@ func request_PoetService_GetProof_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "round_id", err) } - msg, err := client.GetProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Proof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_PoetService_GetProof_0(ctx context.Context, marshaler runtime.Marshaler, server PoetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetProofRequest +func local_request_PoetService_Proof_0(ctx context.Context, marshaler runtime.Marshaler, server PoetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ProofRequest var metadata runtime.ServerMetadata var ( @@ -198,7 +198,7 @@ func local_request_PoetService_GetProof_0(ctx context.Context, marshaler runtime return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "round_id", err) } - msg, err := server.GetProof(ctx, &protoReq) + msg, err := server.Proof(ctx, &protoReq) return msg, metadata, err } @@ -284,7 +284,7 @@ func RegisterPoetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_PoetService_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PoetService_Info_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -292,12 +292,12 @@ func RegisterPoetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rpc.api.v1.PoetService/GetInfo", runtime.WithHTTPPathPattern("/v1/info")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rpc.api.v1.PoetService/Info", runtime.WithHTTPPathPattern("/v1/info")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PoetService_GetInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PoetService_Info_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -305,11 +305,11 @@ func RegisterPoetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_PoetService_GetInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PoetService_Info_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_PoetService_GetProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PoetService_Proof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -317,12 +317,12 @@ func RegisterPoetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rpc.api.v1.PoetService/GetProof", runtime.WithHTTPPathPattern("/v1/proofs/{round_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/rpc.api.v1.PoetService/Proof", runtime.WithHTTPPathPattern("/v1/proofs/{round_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PoetService_GetProof_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PoetService_Proof_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -330,7 +330,7 @@ func RegisterPoetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_PoetService_GetProof_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PoetService_Proof_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -441,47 +441,47 @@ func RegisterPoetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_PoetService_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PoetService_Info_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rpc.api.v1.PoetService/GetInfo", runtime.WithHTTPPathPattern("/v1/info")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rpc.api.v1.PoetService/Info", runtime.WithHTTPPathPattern("/v1/info")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PoetService_GetInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PoetService_Info_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PoetService_GetInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PoetService_Info_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_PoetService_GetProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PoetService_Proof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rpc.api.v1.PoetService/GetProof", runtime.WithHTTPPathPattern("/v1/proofs/{round_id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/rpc.api.v1.PoetService/Proof", runtime.WithHTTPPathPattern("/v1/proofs/{round_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PoetService_GetProof_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PoetService_Proof_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PoetService_GetProof_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PoetService_Proof_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -495,9 +495,9 @@ var ( pattern_PoetService_Submit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "submit"}, "")) - pattern_PoetService_GetInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "info"}, "")) + pattern_PoetService_Info_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "info"}, "")) - pattern_PoetService_GetProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "proofs", "round_id"}, "")) + pattern_PoetService_Proof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "proofs", "round_id"}, "")) ) var ( @@ -507,7 +507,7 @@ var ( forward_PoetService_Submit_0 = runtime.ForwardResponseMessage - forward_PoetService_GetInfo_0 = runtime.ForwardResponseMessage + forward_PoetService_Info_0 = runtime.ForwardResponseMessage - forward_PoetService_GetProof_0 = runtime.ForwardResponseMessage + forward_PoetService_Proof_0 = runtime.ForwardResponseMessage ) diff --git a/release/proto/go/rpc/api/v1/api_grpc.pb.go b/release/proto/go/rpc/api/v1/api_grpc.pb.go index 7944ed54..8101c5ee 100644 --- a/release/proto/go/rpc/api/v1/api_grpc.pb.go +++ b/release/proto/go/rpc/api/v1/api_grpc.pb.go @@ -30,11 +30,11 @@ type PoetServiceClient interface { // Submit adds a challenge to the service's current open round, // to be included its later generated proof. Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error) - // GetInfo returns general information concerning the service, + // Info returns general information concerning the service, // including its identity pubkey. - GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) - // GetProof returns the generated proof for given round id. - GetProof(ctx context.Context, in *GetProofRequest, opts ...grpc.CallOption) (*GetProofResponse, error) + Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) + // roof returns the generated proof for given round id. + Proof(ctx context.Context, in *ProofRequest, opts ...grpc.CallOption) (*ProofResponse, error) } type poetServiceClient struct { @@ -72,18 +72,18 @@ func (c *poetServiceClient) Submit(ctx context.Context, in *SubmitRequest, opts return out, nil } -func (c *poetServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { - out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, "/rpc.api.v1.PoetService/GetInfo", in, out, opts...) +func (c *poetServiceClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + out := new(InfoResponse) + err := c.cc.Invoke(ctx, "/rpc.api.v1.PoetService/Info", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *poetServiceClient) GetProof(ctx context.Context, in *GetProofRequest, opts ...grpc.CallOption) (*GetProofResponse, error) { - out := new(GetProofResponse) - err := c.cc.Invoke(ctx, "/rpc.api.v1.PoetService/GetProof", in, out, opts...) +func (c *poetServiceClient) Proof(ctx context.Context, in *ProofRequest, opts ...grpc.CallOption) (*ProofResponse, error) { + out := new(ProofResponse) + err := c.cc.Invoke(ctx, "/rpc.api.v1.PoetService/Proof", in, out, opts...) if err != nil { return nil, err } @@ -102,11 +102,11 @@ type PoetServiceServer interface { // Submit adds a challenge to the service's current open round, // to be included its later generated proof. Submit(context.Context, *SubmitRequest) (*SubmitResponse, error) - // GetInfo returns general information concerning the service, + // Info returns general information concerning the service, // including its identity pubkey. - GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) - // GetProof returns the generated proof for given round id. - GetProof(context.Context, *GetProofRequest) (*GetProofResponse, error) + Info(context.Context, *InfoRequest) (*InfoResponse, error) + // roof returns the generated proof for given round id. + Proof(context.Context, *ProofRequest) (*ProofResponse, error) } // UnimplementedPoetServiceServer should be embedded to have forward compatible implementations. @@ -122,11 +122,11 @@ func (UnimplementedPoetServiceServer) UpdateGateway(context.Context, *UpdateGate func (UnimplementedPoetServiceServer) Submit(context.Context, *SubmitRequest) (*SubmitResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Submit not implemented") } -func (UnimplementedPoetServiceServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +func (UnimplementedPoetServiceServer) Info(context.Context, *InfoRequest) (*InfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") } -func (UnimplementedPoetServiceServer) GetProof(context.Context, *GetProofRequest) (*GetProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetProof not implemented") +func (UnimplementedPoetServiceServer) Proof(context.Context, *ProofRequest) (*ProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proof not implemented") } // UnsafePoetServiceServer may be embedded to opt out of forward compatibility for this service. @@ -194,38 +194,38 @@ func _PoetService_Submit_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -func _PoetService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInfoRequest) +func _PoetService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PoetServiceServer).GetInfo(ctx, in) + return srv.(PoetServiceServer).Info(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/rpc.api.v1.PoetService/GetInfo", + FullMethod: "/rpc.api.v1.PoetService/Info", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PoetServiceServer).GetInfo(ctx, req.(*GetInfoRequest)) + return srv.(PoetServiceServer).Info(ctx, req.(*InfoRequest)) } return interceptor(ctx, in, info, handler) } -func _PoetService_GetProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProofRequest) +func _PoetService_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProofRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PoetServiceServer).GetProof(ctx, in) + return srv.(PoetServiceServer).Proof(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/rpc.api.v1.PoetService/GetProof", + FullMethod: "/rpc.api.v1.PoetService/Proof", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PoetServiceServer).GetProof(ctx, req.(*GetProofRequest)) + return srv.(PoetServiceServer).Proof(ctx, req.(*ProofRequest)) } return interceptor(ctx, in, info, handler) } @@ -250,12 +250,12 @@ var PoetService_ServiceDesc = grpc.ServiceDesc{ Handler: _PoetService_Submit_Handler, }, { - MethodName: "GetInfo", - Handler: _PoetService_GetInfo_Handler, + MethodName: "Info", + Handler: _PoetService_Info_Handler, }, { - MethodName: "GetProof", - Handler: _PoetService_GetProof_Handler, + MethodName: "Proof", + Handler: _PoetService_Proof_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/release/proto/openapiv2/rpc/api/v1/api.swagger.json b/release/proto/openapiv2/rpc/api/v1/api.swagger.json index 0520a5c6..a7e0cacb 100644 --- a/release/proto/openapiv2/rpc/api/v1/api.swagger.json +++ b/release/proto/openapiv2/rpc/api/v1/api.swagger.json @@ -18,13 +18,13 @@ "paths": { "/v1/info": { "get": { - "summary": "GetInfo returns general information concerning the service,\nincluding its identity pubkey.", - "operationId": "PoetService_GetInfo", + "summary": "Info returns general information concerning the service,\nincluding its identity pubkey.", + "operationId": "PoetService_Info", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetInfoResponse" + "$ref": "#/definitions/v1InfoResponse" } }, "default": { @@ -41,13 +41,13 @@ }, "/v1/proofs/{roundId}": { "get": { - "summary": "GetProof returns the generated proof for given round id.", - "operationId": "PoetService_GetProof", + "summary": "roof returns the generated proof for given round id.", + "operationId": "PoetService_Proof", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1GetProofResponse" + "$ref": "#/definitions/v1ProofResponse" } }, "default": { @@ -198,7 +198,7 @@ } } }, - "v1GetInfoResponse": { + "v1InfoResponse": { "type": "object", "properties": { "openRoundId": { @@ -216,18 +216,6 @@ } } }, - "v1GetProofResponse": { - "type": "object", - "properties": { - "proof": { - "$ref": "#/definitions/v1PoetProof" - }, - "pubkey": { - "type": "string", - "format": "byte" - } - } - }, "v1MerkleProof": { "type": "object", "properties": { @@ -270,6 +258,18 @@ } } }, + "v1ProofResponse": { + "type": "object", + "properties": { + "proof": { + "$ref": "#/definitions/v1PoetProof" + }, + "pubkey": { + "type": "string", + "format": "byte" + } + } + }, "v1StartRequest": { "type": "object", "properties": { diff --git a/rpc/api/v1/api.proto b/rpc/api/v1/api.proto index ef3d3181..4797e381 100644 --- a/rpc/api/v1/api.proto +++ b/rpc/api/v1/api.proto @@ -39,19 +39,19 @@ service PoetService { } /** - GetInfo returns general information concerning the service, + Info returns general information concerning the service, including its identity pubkey. */ - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) { + rpc Info (InfoRequest) returns (InfoResponse) { option (google.api.http) = { get: "/v1/info" }; } /** - GetProof returns the generated proof for given round id. + roof returns the generated proof for given round id. */ - rpc GetProof(GetProofRequest) returns (GetProofResponse) { + rpc Proof(ProofRequest) returns (ProofResponse) { option (google.api.http) = { get: "/v1/proofs/{round_id}" }; @@ -85,10 +85,10 @@ message SubmitResponse { google.protobuf.Duration round_end = 3; } -message GetInfoRequest { +message InfoRequest { } -message GetInfoResponse { +message InfoResponse { string open_round_id = 1; repeated string executing_rounds_ids = 2; bytes service_pubkey = 3; @@ -112,11 +112,11 @@ message PoetProof { uint64 leaves = 3; } -message GetProofRequest { +message ProofRequest { string round_id = 1; } -message GetProofResponse { +message ProofResponse { PoetProof proof = 1; bytes pubkey = 2; } diff --git a/rpc/rpcserver.go b/rpc/rpcserver.go index 167da821..59bf2b62 100644 --- a/rpc/rpcserver.go +++ b/rpc/rpcserver.go @@ -155,13 +155,13 @@ func (r *rpcServer) Submit(ctx context.Context, in *api.SubmitRequest) (*api.Sub } // GetInfo implements api.GetInfo. -func (r *rpcServer) GetInfo(ctx context.Context, in *api.GetInfoRequest) (*api.GetInfoResponse, error) { +func (r *rpcServer) Info(ctx context.Context, in *api.InfoRequest) (*api.InfoResponse, error) { info, err := r.s.Info(ctx) if err != nil { return nil, err } - out := new(api.GetInfoResponse) + out := new(api.InfoResponse) out.OpenRoundId = info.OpenRoundID ids := make([]string, len(info.ExecutingRoundsIds)) @@ -173,7 +173,7 @@ func (r *rpcServer) GetInfo(ctx context.Context, in *api.GetInfoRequest) (*api.G } // GetProof implements api.PoetServer. -func (r *rpcServer) GetProof(ctx context.Context, in *api.GetProofRequest) (*api.GetProofResponse, error) { +func (r *rpcServer) Proof(ctx context.Context, in *api.ProofRequest) (*api.ProofResponse, error) { if info, err := r.s.Info(ctx); err == nil { if info.OpenRoundID == in.RoundId || slices.Contains(info.ExecutingRoundsIds, in.RoundId) { return nil, status.Error(codes.Unavailable, "round is not finished yet") @@ -186,7 +186,7 @@ func (r *rpcServer) GetProof(ctx context.Context, in *api.GetProofRequest) (*api case errors.Is(err, service.ErrNotFound): return nil, status.Error(codes.NotFound, "proof not found") case err == nil: - out := api.GetProofResponse{ + out := api.ProofResponse{ Proof: &api.PoetProof{ Proof: &api.MerkleProof{ Root: proof.Root, diff --git a/scripts/fuzz.sh b/scripts/fuzz.sh new file mode 100755 index 00000000..ce6857bf --- /dev/null +++ b/scripts/fuzz.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# https://github.com/golang/go/issues/46312 + +set -e + +fuzzTime=${1:-"10s"} + +files=$(grep -r --include='**_test.go' --files-with-matches 'func Fuzz' .) + +for file in ${files} +do + funcs=$(grep -oP 'func \K(Fuzz\w*)' $file) + for func in ${funcs} + do + parentDir=$(dirname $file) + command="go test $parentDir -run=$func -fuzz=$func -fuzztime=${fuzzTime}" + echo $command + eval $command + done +done diff --git a/server/server_test.go b/server/server_test.go index 354e63f9..9b361b8a 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -96,7 +96,7 @@ func TestPoetStart(t *testing.T) { return srv.Start(ctx) }) - resp, err := client.GetInfo(context.Background(), &api.GetInfoRequest{}) + resp, err := client.Info(context.Background(), &api.InfoRequest{}) req.NoError(err) req.Equal("0", resp.OpenRoundId) @@ -141,9 +141,9 @@ func TestSubmitAndGetProof(t *testing.T) { <-time.After(roundEnd) // Query for the proof - var proof *api.GetProofResponse + var proof *api.ProofResponse req.Eventually(func() bool { - proof, err = client.GetProof(context.Background(), &api.GetProofRequest{RoundId: resp.RoundId}) + proof, err = client.Proof(context.Background(), &api.ProofRequest{RoundId: resp.RoundId}) return err == nil }, time.Second, time.Millisecond*100) diff --git a/shared/shared.go b/shared/shared.go index 0ab84247..e44aab65 100644 --- a/shared/shared.go +++ b/shared/shared.go @@ -2,14 +2,14 @@ package shared import ( "encoding/binary" + "fmt" "os" + "github.com/spacemeshos/go-scale" "github.com/spacemeshos/merkle-tree" "github.com/spacemeshos/sha256-simd" ) -//go:generate scalegen -types MerkleProof - const ( // T is the security param which determines the number of leaves // to be included in a non-interactive proof. @@ -75,8 +75,99 @@ func MakeLabelFunc() func(hash LabelHash, labelID uint64, leftSiblings [][]byte) } } +// MerkleProof is a non-interactive proof of inclusion in a Merkle tree. +// Scale encoding is implemented by hand to be able to limit [][]byte slices to a maximum size (inner and outer slices). type MerkleProof struct { - Root []byte - ProvenLeaves [][]byte - ProofNodes [][]byte + Root []byte `scale:"max=32"` + ProvenLeaves [][]byte `scale:"max=150"` // the max. size of this slice is T (security param), and each element is exactly 32 bytes + ProofNodes [][]byte `scale:"max=5400"` // 36 nodes per leaf and each node is exactly 32 bytes +} + +func (t *MerkleProof) EncodeScale(enc *scale.Encoder) (total int, err error) { + { + n, err := scale.EncodeByteSliceWithLimit(enc, t.Root, 32) + if err != nil { + return total, err + } + total += n + } + { + n, err := scale.EncodeLen(enc, uint32(len(t.ProvenLeaves)), 150) + if err != nil { + return total, fmt.Errorf("EncodeLen failed: %w", err) + } + for _, byteSlice := range t.ProvenLeaves { + n, err := scale.EncodeByteSliceWithLimit(enc, byteSlice, 32) + if err != nil { + return 0, fmt.Errorf("EncodeByteSliceWithLimit failed: %w", err) + } + total += n + } + total += n + } + { + n, err := scale.EncodeLen(enc, uint32(len(t.ProofNodes)), 5400) + if err != nil { + return total, fmt.Errorf("EncodeLen failed: %w", err) + } + for _, byteSlice := range t.ProofNodes { + n, err := scale.EncodeByteSliceWithLimit(enc, byteSlice, 32) + if err != nil { + return 0, fmt.Errorf("EncodeByteSliceWithLimit failed: %w", err) + } + total += n + } + total += n + } + return total, nil +} + +func (t *MerkleProof) DecodeScale(dec *scale.Decoder) (total int, err error) { + { + field, n, err := scale.DecodeByteSliceWithLimit(dec, 32) + if err != nil { + return total, err + } + total += n + t.Root = field + } + { + field, n, err := DecodeSliceOfByteSliceWithLimit(dec, 150, 32) + if err != nil { + return total, err + } + total += n + t.ProvenLeaves = field + } + { + field, n, err := DecodeSliceOfByteSliceWithLimit(dec, 5400, 32) + if err != nil { + return total, err + } + total += n + t.ProofNodes = field + } + return total, nil +} + +func DecodeSliceOfByteSliceWithLimit(d *scale.Decoder, outerLimit, innerLimit uint32) ([][]byte, int, error) { + resultLen, total, err := scale.DecodeLen(d, outerLimit) + if err != nil { + return nil, 0, fmt.Errorf("DecodeLen failed: %w", err) + } + if resultLen == 0 { + return nil, 0, nil + } + result := make([][]byte, 0, resultLen) + + for i := uint32(0); i < resultLen; i++ { + val, n, err := scale.DecodeByteSliceWithLimit(d, innerLimit) + if err != nil { + return nil, 0, fmt.Errorf("DecodeByteSlice failed: %w", err) + } + result = append(result, val) + total += n + } + + return result, total, nil } diff --git a/shared/shared_scale.go b/shared/shared_scale.go deleted file mode 100644 index 7d302736..00000000 --- a/shared/shared_scale.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by github.com/spacemeshos/go-scale/scalegen. DO NOT EDIT. - -// nolint -package shared - -import ( - "github.com/spacemeshos/go-scale" -) - -func (t *MerkleProof) EncodeScale(enc *scale.Encoder) (total int, err error) { - { - n, err := scale.EncodeByteSlice(enc, t.Root) - if err != nil { - return total, err - } - total += n - } - { - n, err := scale.EncodeSliceOfByteSlice(enc, t.ProvenLeaves) - if err != nil { - return total, err - } - total += n - } - { - n, err := scale.EncodeSliceOfByteSlice(enc, t.ProofNodes) - if err != nil { - return total, err - } - total += n - } - return total, nil -} - -func (t *MerkleProof) DecodeScale(dec *scale.Decoder) (total int, err error) { - { - field, n, err := scale.DecodeByteSlice(dec) - if err != nil { - return total, err - } - total += n - t.Root = field - } - { - field, n, err := scale.DecodeSliceOfByteSlice(dec) - if err != nil { - return total, err - } - total += n - t.ProvenLeaves = field - } - { - field, n, err := scale.DecodeSliceOfByteSlice(dec) - if err != nil { - return total, err - } - total += n - t.ProofNodes = field - } - return total, nil -} diff --git a/shared/shared_test.go b/shared/shared_test.go index 0f68552f..be9b85bc 100644 --- a/shared/shared_test.go +++ b/shared/shared_test.go @@ -95,10 +95,12 @@ func TestMakeLabel(t *testing.T) { } func FuzzMerkleProofConsistency(f *testing.F) { + f.Add([]byte("018912380012")) tester.FuzzConsistency[MerkleProof](f) } func FuzzMerkleProofSafety(f *testing.F) { + f.Add([]byte("018912380012")) tester.FuzzSafety[MerkleProof](f) } diff --git a/verifier/verifier.go b/verifier/verifier.go index 38460715..9d03b17c 100644 --- a/verifier/verifier.go +++ b/verifier/verifier.go @@ -21,8 +21,21 @@ func Validate(proof shared.MerkleProof, labelHashFunc func(data []byte) []byte, len(proof.ProvenLeaves), securityParam) } provenLeafIndices := asSortedSlice(shared.FiatShamir(proof.Root, numLeaves, securityParam)) - valid, parkingSnapshots, err := merkle.ValidatePartialTreeWithParkingSnapshots(provenLeafIndices, - proof.ProvenLeaves, proof.ProofNodes, proof.Root, merkleHashFunc) + provenLeaves := make([][]byte, 0, len(proof.ProvenLeaves)) + for i := range proof.ProvenLeaves { + provenLeaves = append(provenLeaves, proof.ProvenLeaves[i][:]) + } + proofNodes := make([][]byte, 0, len(proof.ProofNodes)) + for i := range proof.ProofNodes { + proofNodes = append(proofNodes, proof.ProofNodes[i][:]) + } + valid, parkingSnapshots, err := merkle.ValidatePartialTreeWithParkingSnapshots( + provenLeafIndices, + provenLeaves, + proofNodes, + proof.Root, + merkleHashFunc, + ) if err != nil { return fmt.Errorf("error while validating merkle proof: %v", err) } @@ -33,7 +46,7 @@ func Validate(proof shared.MerkleProof, labelHashFunc func(data []byte) []byte, makeLabel := shared.MakeLabelFunc() for id, label := range proof.ProvenLeaves { expectedLabel := makeLabel(labelHashFunc, provenLeafIndices[id], parkingSnapshots[id]) - if !bytes.Equal(expectedLabel, label) { + if !bytes.Equal(expectedLabel, label[:]) { return fmt.Errorf("label at index %d incorrect - expected: %x actual: %x", id, expectedLabel, label) } } diff --git a/verifier/verifier_test.go b/verifier/verifier_test.go index 8e2945da..df8e69c9 100644 --- a/verifier/verifier_test.go +++ b/verifier/verifier_test.go @@ -50,7 +50,7 @@ func TestValidate(t *testing.T) { func TestValidateWrongSecParam(t *testing.T) { merkleProof := shared.MerkleProof{ Root: nil, - ProvenLeaves: [][]byte{nil, nil}, + ProvenLeaves: make([][]byte, 2), ProofNodes: nil, } challenge := []byte("challenge") @@ -69,7 +69,7 @@ func TestValidateWrongSecParam(t *testing.T) { func TestValidateWrongMerkleValidationError(t *testing.T) { merkleProof := shared.MerkleProof{ Root: nil, - ProvenLeaves: [][]byte{}, + ProvenLeaves: make([][]byte, 0), ProofNodes: nil, } challenge := []byte("challenge")