diff --git a/proto/lavanet/lava/conflict/query.proto b/proto/lavanet/lava/conflict/query.proto index 5552ff3e95..157a2e3e07 100644 --- a/proto/lavanet/lava/conflict/query.proto +++ b/proto/lavanet/lava/conflict/query.proto @@ -31,6 +31,11 @@ service Query { option (google.api.http).get = "/lavanet/lava/conflict/consumer_conflicts/{consumer}"; } + // Queries a provider's conflict list (ones that the provider was reported in and ones that the provider needs to vote) + rpc ProviderConflicts(QueryProviderConflictsRequest) returns (QueryProviderConflictsResponse) { + option (google.api.http).get = "/lavanet/lava/conflict/provider_conflicts/{provider}"; + } + // this line is used by starport scaffolding # 2 } @@ -61,6 +66,15 @@ message QueryAllConflictVoteResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryProviderConflictsRequest { + string provider = 1; +} + +message QueryProviderConflictsResponse { + repeated string reported = 1; + repeated string not_voted = 2; +} + message QueryConsumerConflictsRequest { string consumer = 1; } diff --git a/scripts/cli_test.sh b/scripts/cli_test.sh index 44f557df1d..3ac4d992a9 100755 --- a/scripts/cli_test.sh +++ b/scripts/cli_test.sh @@ -49,6 +49,7 @@ trace lavad q protocol params >/dev/null echo "Testing conflict q commands" trace lavad q conflict params >/dev/null trace lavad q conflict list-conflict-vote >/dev/null +trace lavad q conflict provider-conflicts $(lavad keys show servicer1 -a) >/dev/null trace lavad q conflict consumer-conflicts $(lavad keys show user1 -a) >/dev/null # trace lavad q conflict show-conflict-vote stam >/dev/null ## canot test that here diff --git a/x/conflict/client/cli/query.go b/x/conflict/client/cli/query.go index 4b98818dbc..222a7d7e74 100644 --- a/x/conflict/client/cli/query.go +++ b/x/conflict/client/cli/query.go @@ -27,6 +27,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListConflictVote()) cmd.AddCommand(CmdShowConflictVote()) + cmd.AddCommand(CmdProviderConflicts()) cmd.AddCommand(CmdConsumerConflicts()) // this line is used by starport scaffolding # 1 diff --git a/x/conflict/client/cli/query_provider_conflicts.go b/x/conflict/client/cli/query_provider_conflicts.go new file mode 100644 index 0000000000..3997235c31 --- /dev/null +++ b/x/conflict/client/cli/query_provider_conflicts.go @@ -0,0 +1,36 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/x/conflict/types" + "github.com/spf13/cobra" +) + +func CmdProviderConflicts() *cobra.Command { + cmd := &cobra.Command{ + Use: "provider-conflicts ", + Short: "Queries a provider's conflict list (ones that the provider was reported in and ones that the provider needs to vote)", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryProviderConflictsRequest{ + Provider: args[0], + } + + res, err := queryClient.ProviderConflicts(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/conflict/keeper/grpc_query_provider_conflicts.go b/x/conflict/keeper/grpc_query_provider_conflicts.go new file mode 100644 index 0000000000..e9210ba129 --- /dev/null +++ b/x/conflict/keeper/grpc_query_provider_conflicts.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/x/conflict/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ProviderConflicts(c context.Context, req *types.QueryProviderConflictsRequest) (*types.QueryProviderConflictsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var ( + reported []string + notVoted []string + ) + + ctx := sdk.UnwrapSDKContext(c) + conflicts := k.GetAllConflictVote(ctx) + + for _, conflict := range conflicts { + if conflict.FirstProvider.Account == req.Provider || + conflict.SecondProvider.Account == req.Provider { + reported = append(reported, conflict.Index) + } + + for _, vote := range conflict.Votes { + if vote.Address == req.Provider && vote.Result == types.NoVote { + notVoted = append(notVoted, conflict.Index) + } + } + } + + return &types.QueryProviderConflictsResponse{Reported: reported, NotVoted: notVoted}, nil +} diff --git a/x/conflict/keeper/grpc_query_provider_conflicts_test.go b/x/conflict/keeper/grpc_query_provider_conflicts_test.go new file mode 100644 index 0000000000..36418f64fc --- /dev/null +++ b/x/conflict/keeper/grpc_query_provider_conflicts_test.go @@ -0,0 +1,117 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/lavanet/lava/testutil/keeper" + "github.com/lavanet/lava/x/conflict/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestProviderConflicts(t *testing.T) { + keeper, ctx := keepertest.ConflictKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNConflictVote(keeper, ctx, 7) + + const ( + FIRST_PROVIDER = 0 + SECOND_PROVIDER = 1 + NONE_OF_THE_PROVIDERS = 2 + NOT_VOTED = 3 + VOTED = 4 + PROVIDER_REPORTED_AND_NOT_VOTED = 5 + PROVIDER_REPORTED_AND_VOTED = 6 + ) + + var providers []string + for i := range msgs { + providers = append(providers, "p"+strconv.Itoa(i)) + } + + for i, msg := range msgs { + switch i { + case FIRST_PROVIDER: + msg.FirstProvider.Account = providers[FIRST_PROVIDER] + case SECOND_PROVIDER: + msg.SecondProvider.Account = providers[SECOND_PROVIDER] + case NONE_OF_THE_PROVIDERS: + msg.FirstProvider.Account = providers[NONE_OF_THE_PROVIDERS] + msg.SecondProvider.Account = providers[NONE_OF_THE_PROVIDERS] + case NOT_VOTED: + msg.Votes = append(msg.Votes, types.Vote{Address: providers[NOT_VOTED], Result: types.NoVote}) + case VOTED: + msg.Votes = append(msg.Votes, types.Vote{Address: providers[VOTED], Result: types.Provider0}) + case PROVIDER_REPORTED_AND_NOT_VOTED: + msg.FirstProvider.Account = providers[PROVIDER_REPORTED_AND_NOT_VOTED] + msg.Votes = append(msg.Votes, types.Vote{Address: providers[PROVIDER_REPORTED_AND_NOT_VOTED], Result: types.NoVote}) + case PROVIDER_REPORTED_AND_VOTED: + msg.FirstProvider.Account = providers[PROVIDER_REPORTED_AND_VOTED] + msg.Votes = append(msg.Votes, types.Vote{Address: providers[PROVIDER_REPORTED_AND_VOTED], Result: types.Provider0}) + } + + keeper.SetConflictVote(ctx, msg) + } + + for _, tc := range []struct { + desc string + provider string + expectedReported []string + expectedNotVoted []string + }{ + { + desc: "First provider", + provider: providers[FIRST_PROVIDER], + expectedReported: []string{strconv.Itoa(FIRST_PROVIDER)}, + expectedNotVoted: []string{}, + }, + { + desc: "Second provider", + provider: providers[SECOND_PROVIDER], + expectedReported: []string{strconv.Itoa(SECOND_PROVIDER)}, + expectedNotVoted: []string{}, + }, + { + desc: "None of the providers", + provider: "dummy", + expectedReported: []string{}, + expectedNotVoted: []string{}, + }, + { + desc: "Not voted", + provider: providers[NOT_VOTED], + expectedReported: []string{}, + expectedNotVoted: []string{strconv.Itoa(NOT_VOTED)}, + }, + { + desc: "Voted", + provider: providers[VOTED], + expectedReported: []string{}, + expectedNotVoted: []string{}, + }, + { + desc: "Provider reported and not voted", + provider: providers[PROVIDER_REPORTED_AND_NOT_VOTED], + expectedReported: []string{strconv.Itoa(PROVIDER_REPORTED_AND_NOT_VOTED)}, + expectedNotVoted: []string{strconv.Itoa(PROVIDER_REPORTED_AND_NOT_VOTED)}, + }, + { + desc: "First Provider and voted", + provider: providers[PROVIDER_REPORTED_AND_VOTED], + expectedReported: []string{strconv.Itoa(PROVIDER_REPORTED_AND_VOTED)}, + expectedNotVoted: []string{}, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + res, err := keeper.ProviderConflicts(wctx, &types.QueryProviderConflictsRequest{Provider: tc.provider}) + require.Nil(t, err) + require.ElementsMatch(t, res.NotVoted, tc.expectedNotVoted) + require.ElementsMatch(t, res.Reported, tc.expectedReported) + }) + } +} diff --git a/x/conflict/types/query.pb.go b/x/conflict/types/query.pb.go index 2c92db5678..bd075b79ba 100644 --- a/x/conflict/types/query.pb.go +++ b/x/conflict/types/query.pb.go @@ -297,6 +297,102 @@ func (m *QueryAllConflictVoteResponse) GetPagination() *query.PageResponse { return nil } +type QueryProviderConflictsRequest struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` +} + +func (m *QueryProviderConflictsRequest) Reset() { *m = QueryProviderConflictsRequest{} } +func (m *QueryProviderConflictsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProviderConflictsRequest) ProtoMessage() {} +func (*QueryProviderConflictsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1179eb365bacd460, []int{6} +} +func (m *QueryProviderConflictsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProviderConflictsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProviderConflictsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProviderConflictsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProviderConflictsRequest.Merge(m, src) +} +func (m *QueryProviderConflictsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProviderConflictsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProviderConflictsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProviderConflictsRequest proto.InternalMessageInfo + +func (m *QueryProviderConflictsRequest) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +type QueryProviderConflictsResponse struct { + Reported []string `protobuf:"bytes,1,rep,name=reported,proto3" json:"reported,omitempty"` + NotVoted []string `protobuf:"bytes,2,rep,name=not_voted,json=notVoted,proto3" json:"not_voted,omitempty"` +} + +func (m *QueryProviderConflictsResponse) Reset() { *m = QueryProviderConflictsResponse{} } +func (m *QueryProviderConflictsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProviderConflictsResponse) ProtoMessage() {} +func (*QueryProviderConflictsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1179eb365bacd460, []int{7} +} +func (m *QueryProviderConflictsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProviderConflictsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProviderConflictsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProviderConflictsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProviderConflictsResponse.Merge(m, src) +} +func (m *QueryProviderConflictsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProviderConflictsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProviderConflictsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProviderConflictsResponse proto.InternalMessageInfo + +func (m *QueryProviderConflictsResponse) GetReported() []string { + if m != nil { + return m.Reported + } + return nil +} + +func (m *QueryProviderConflictsResponse) GetNotVoted() []string { + if m != nil { + return m.NotVoted + } + return nil +} + type QueryConsumerConflictsRequest struct { Consumer string `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer,omitempty"` } @@ -305,7 +401,7 @@ func (m *QueryConsumerConflictsRequest) Reset() { *m = QueryConsumerConf func (m *QueryConsumerConflictsRequest) String() string { return proto.CompactTextString(m) } func (*QueryConsumerConflictsRequest) ProtoMessage() {} func (*QueryConsumerConflictsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1179eb365bacd460, []int{6} + return fileDescriptor_1179eb365bacd460, []int{8} } func (m *QueryConsumerConflictsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +445,7 @@ func (m *QueryConsumerConflictsResponse) Reset() { *m = QueryConsumerCon func (m *QueryConsumerConflictsResponse) String() string { return proto.CompactTextString(m) } func (*QueryConsumerConflictsResponse) ProtoMessage() {} func (*QueryConsumerConflictsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1179eb365bacd460, []int{7} + return fileDescriptor_1179eb365bacd460, []int{9} } func (m *QueryConsumerConflictsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -392,6 +488,8 @@ func init() { proto.RegisterType((*QueryGetConflictVoteResponse)(nil), "lavanet.lava.conflict.QueryGetConflictVoteResponse") proto.RegisterType((*QueryAllConflictVoteRequest)(nil), "lavanet.lava.conflict.QueryAllConflictVoteRequest") proto.RegisterType((*QueryAllConflictVoteResponse)(nil), "lavanet.lava.conflict.QueryAllConflictVoteResponse") + proto.RegisterType((*QueryProviderConflictsRequest)(nil), "lavanet.lava.conflict.QueryProviderConflictsRequest") + proto.RegisterType((*QueryProviderConflictsResponse)(nil), "lavanet.lava.conflict.QueryProviderConflictsResponse") proto.RegisterType((*QueryConsumerConflictsRequest)(nil), "lavanet.lava.conflict.QueryConsumerConflictsRequest") proto.RegisterType((*QueryConsumerConflictsResponse)(nil), "lavanet.lava.conflict.QueryConsumerConflictsResponse") } @@ -399,44 +497,49 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/conflict/query.proto", fileDescriptor_1179eb365bacd460) } var fileDescriptor_1179eb365bacd460 = []byte{ - // 587 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xb1, 0x6f, 0x13, 0x3f, - 0x14, 0xc7, 0xe3, 0xfe, 0x7e, 0x89, 0x88, 0xa9, 0x84, 0x30, 0x41, 0x42, 0x47, 0x72, 0x05, 0x03, - 0xa5, 0xad, 0x2a, 0x5b, 0x4d, 0x02, 0x4b, 0x11, 0x52, 0x53, 0x89, 0x4e, 0x48, 0xe5, 0x06, 0x06, - 0x96, 0xca, 0x39, 0xcc, 0x71, 0xd2, 0xe5, 0x7c, 0x8d, 0x9d, 0xa8, 0x55, 0xd5, 0x85, 0x81, 0x19, - 0x89, 0x7f, 0x82, 0x01, 0x56, 0x46, 0xe6, 0x8e, 0x95, 0x58, 0x98, 0x10, 0x4a, 0xf8, 0x43, 0x50, - 0x6c, 0x5f, 0x93, 0x28, 0x77, 0x21, 0x15, 0xd3, 0xf9, 0x7c, 0xef, 0xfb, 0x7d, 0x9f, 0xe7, 0xf7, - 0x7c, 0xf0, 0x6e, 0xc4, 0xfa, 0x2c, 0xe6, 0x8a, 0x8e, 0x9e, 0xd4, 0x17, 0xf1, 0x9b, 0x28, 0xf4, - 0x15, 0x3d, 0xec, 0xf1, 0xee, 0x31, 0x49, 0xba, 0x42, 0x09, 0x74, 0xd3, 0x86, 0x90, 0xd1, 0x93, - 0xa4, 0x21, 0x4e, 0x35, 0x10, 0x22, 0x88, 0x38, 0x65, 0x49, 0x48, 0x59, 0x1c, 0x0b, 0xc5, 0x54, - 0x28, 0x62, 0x69, 0x44, 0xce, 0x86, 0x2f, 0x64, 0x47, 0x48, 0xda, 0x66, 0x92, 0x1b, 0x37, 0xda, - 0xdf, 0x6a, 0x73, 0xc5, 0xb6, 0x68, 0xc2, 0x82, 0x30, 0xd6, 0xc1, 0x36, 0x16, 0x67, 0x33, 0x24, - 0xac, 0xcb, 0x3a, 0xa9, 0xdf, 0x7a, 0x76, 0x4c, 0xba, 0x38, 0xe8, 0x0b, 0xc5, 0x6d, 0x68, 0x25, - 0x10, 0x81, 0xd0, 0x4b, 0x3a, 0x5a, 0x99, 0x5d, 0x5c, 0x81, 0xe8, 0xc5, 0x08, 0x63, 0x5f, 0xbb, - 0x7a, 0xfc, 0xb0, 0xc7, 0xa5, 0xc2, 0x1e, 0xbc, 0x31, 0xb5, 0x2b, 0x13, 0x11, 0x4b, 0x8e, 0xb6, - 0x61, 0xc9, 0x64, 0xbf, 0x05, 0xee, 0x80, 0xb5, 0xab, 0xf5, 0x1a, 0xc9, 0x3c, 0x03, 0x62, 0x64, - 0xad, 0xff, 0xcf, 0x7e, 0xae, 0x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 0xdf, 0x1f, 0x97, 0x56, 0x50, 0x8d, 0xce, - 0xbb, 0x84, 0xe8, 0x0b, 0x80, 0xcb, 0x93, 0xa7, 0x8f, 0xea, 0xf3, 0x72, 0x64, 0x4f, 0xbe, 0xd3, - 0xb8, 0x94, 0xc6, 0x02, 0x36, 0x35, 0x20, 0x41, 0x9b, 0x74, 0x81, 0x3f, 0x00, 0x3d, 0xd1, 0xb7, - 0xe9, 0x14, 0x7d, 0x02, 0xf0, 0xda, 0xa4, 0xdd, 0x4e, 0x14, 0xcd, 0x47, 0xce, 0xbe, 0x08, 0xf3, - 0x91, 0x73, 0x86, 0x1a, 0x6f, 0x6a, 0xe4, 0x55, 0x74, 0x7f, 0x11, 0x64, 0xf4, 0x0d, 0xc0, 0xeb, - 0x33, 0x93, 0x82, 0x9a, 0xf3, 0x12, 0xe7, 0x4d, 0xa5, 0xf3, 0xe8, 0x92, 0x2a, 0x0b, 0xfc, 0x44, - 0x03, 0x3f, 0x46, 0xcd, 0x7c, 0x60, 0xad, 0x3c, 0xb8, 0x98, 0x51, 0x7a, 0x92, 0xee, 0x9d, 0xb6, - 0x5a, 0x67, 0x03, 0x17, 0x9c, 0x0f, 0x5c, 0xf0, 0x6b, 0xe0, 0x82, 0x0f, 0x43, 0xb7, 0x70, 0x3e, - 0x74, 0x0b, 0x3f, 0x86, 0x6e, 0xe1, 0xd5, 0x5a, 0x10, 0xaa, 0xb7, 0xbd, 0x36, 0xf1, 0x45, 0x67, - 0xda, 0xf9, 0x68, 0xec, 0xad, 0x8e, 0x13, 0x2e, 0xdb, 0x25, 0xfd, 0x93, 0x6e, 0xfc, 0x09, 0x00, - 0x00, 0xff, 0xff, 0xcc, 0xe9, 0x34, 0x02, 0x8f, 0x06, 0x00, 0x00, + // 662 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 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x92, 0xc0, 0x4f, 0x39, 0xf0, 0x13, 0xd8, 0xcc, 0x06, 0xe6, 0xca, 0xe3, 0xc9, 0x8c, 0xa2, 0x73, + 0x65, 0x1b, 0xf0, 0x02, 0xe6, 0x56, 0x30, 0xbf, 0x80, 0xac, 0x75, 0xcf, 0x2f, 0x20, 0x73, 0xcf, + 0xaf, 0x2c, 0x40, 0x5d, 0x19, 0xc9, 0x02, 0x94, 0x6d, 0xd0, 0x6a, 0x5d, 0x0c, 0x0d, 0xed, 0x72, + 0x68, 0x68, 0xbf, 0x86, 0x86, 0xf6, 0x71, 0x64, 0x14, 0x2e, 0x47, 0x46, 0xe1, 0xc7, 0xc8, 0x28, + 0xbc, 0xd9, 0xf4, 0x7c, 0xf6, 0xae, 0xd7, 0xb6, 0x5c, 0xda, 0x9d, 0x8d, 0x7c, 0x3a, 0x8d, 0xcd, + 0xce, 0x42, 0x1c, 0xb7, 0x4b, 0xfc, 0xdf, 0xaf, 0xf1, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x09, + 0xd5, 0x79, 0xe8, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -459,6 +562,8 @@ type QueryClient interface { ConflictVoteAll(ctx context.Context, in *QueryAllConflictVoteRequest, opts ...grpc.CallOption) (*QueryAllConflictVoteResponse, error) // Gets a consumer's active conflict list. ConsumerConflicts(ctx context.Context, in *QueryConsumerConflictsRequest, opts ...grpc.CallOption) (*QueryConsumerConflictsResponse, error) + // Queries a provider's conflict list (ones that the provider was reported in and ones that the provider needs to vote) + ProviderConflicts(ctx context.Context, in *QueryProviderConflictsRequest, opts ...grpc.CallOption) (*QueryProviderConflictsResponse, error) } type queryClient struct { @@ -505,6 +610,15 @@ func (c *queryClient) ConsumerConflicts(ctx context.Context, in *QueryConsumerCo return out, nil } +func (c *queryClient) ProviderConflicts(ctx context.Context, in *QueryProviderConflictsRequest, opts ...grpc.CallOption) (*QueryProviderConflictsResponse, error) { + out := new(QueryProviderConflictsResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.conflict.Query/ProviderConflicts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -515,6 +629,8 @@ type QueryServer interface { ConflictVoteAll(context.Context, *QueryAllConflictVoteRequest) (*QueryAllConflictVoteResponse, error) // Gets a consumer's active conflict list. ConsumerConflicts(context.Context, *QueryConsumerConflictsRequest) (*QueryConsumerConflictsResponse, error) + // Queries a provider's conflict list (ones that the provider was reported in and ones that the provider needs to vote) + ProviderConflicts(context.Context, *QueryProviderConflictsRequest) (*QueryProviderConflictsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -533,6 +649,9 @@ func (*UnimplementedQueryServer) ConflictVoteAll(ctx context.Context, req *Query func (*UnimplementedQueryServer) ConsumerConflicts(ctx context.Context, req *QueryConsumerConflictsRequest) (*QueryConsumerConflictsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ConsumerConflicts not implemented") } +func (*UnimplementedQueryServer) ProviderConflicts(ctx context.Context, req *QueryProviderConflictsRequest) (*QueryProviderConflictsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProviderConflicts not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -610,6 +729,24 @@ func _Query_ConsumerConflicts_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_ProviderConflicts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProviderConflictsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ProviderConflicts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.conflict.Query/ProviderConflicts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ProviderConflicts(ctx, req.(*QueryProviderConflictsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.conflict.Query", HandlerType: (*QueryServer)(nil), @@ -630,6 +767,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ConsumerConflicts", Handler: _Query_ConsumerConflicts_Handler, }, + { + MethodName: "ProviderConflicts", + Handler: _Query_ProviderConflicts_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "lavanet/lava/conflict/query.proto", @@ -838,6 +979,77 @@ func (m *QueryAllConflictVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryProviderConflictsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProviderConflictsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProviderConflictsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryProviderConflictsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProviderConflictsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProviderConflictsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NotVoted) > 0 { + for iNdEx := len(m.NotVoted) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NotVoted[iNdEx]) + copy(dAtA[i:], m.NotVoted[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.NotVoted[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Reported) > 0 { + for iNdEx := len(m.Reported) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Reported[iNdEx]) + copy(dAtA[i:], m.Reported[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Reported[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryConsumerConflictsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -987,6 +1199,40 @@ func (m *QueryAllConflictVoteResponse) Size() (n int) { return n } +func (m *QueryProviderConflictsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProviderConflictsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Reported) > 0 { + for _, s := range m.Reported { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.NotVoted) > 0 { + for _, s := range m.NotVoted { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryConsumerConflictsRequest) Size() (n int) { if m == nil { return 0 @@ -1525,6 +1771,202 @@ func (m *QueryAllConflictVoteResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryProviderConflictsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProviderConflictsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProviderConflictsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProviderConflictsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProviderConflictsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProviderConflictsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reported", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reported = append(m.Reported, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NotVoted", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NotVoted = append(m.NotVoted, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryConsumerConflictsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/conflict/types/query.pb.gw.go b/x/conflict/types/query.pb.gw.go index 4776ac58ff..61f0407187 100644 --- a/x/conflict/types/query.pb.gw.go +++ b/x/conflict/types/query.pb.gw.go @@ -195,6 +195,60 @@ func local_request_Query_ConsumerConflicts_0(ctx context.Context, marshaler runt } +func request_Query_ProviderConflicts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProviderConflictsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + msg, err := client.ProviderConflicts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ProviderConflicts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProviderConflictsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + msg, err := server.ProviderConflicts(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -293,6 +347,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ProviderConflicts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ProviderConflicts_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProviderConflicts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -414,6 +491,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ProviderConflicts_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ProviderConflicts_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProviderConflicts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -425,6 +522,8 @@ var ( pattern_Query_ConflictVoteAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "conflict", "conflict_vote"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ConsumerConflicts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "conflict", "consumer_conflicts", "consumer"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ProviderConflicts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "conflict", "provider_conflicts", "provider"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -435,4 +534,6 @@ var ( forward_Query_ConflictVoteAll_0 = runtime.ForwardResponseMessage forward_Query_ConsumerConflicts_0 = runtime.ForwardResponseMessage + + forward_Query_ProviderConflicts_0 = runtime.ForwardResponseMessage )