diff --git a/proto/sunrise/da/v1/query.proto b/proto/sunrise/da/v1/query.proto index d17a5d3a..68e180ee 100644 --- a/proto/sunrise/da/v1/query.proto +++ b/proto/sunrise/da/v1/query.proto @@ -40,6 +40,10 @@ service Query { rpc AllInvalidity(QueryAllInvalidityRequest) returns (QueryAllInvalidityResponse) { option (google.api.http).get = "/sunrise/v1/da/all-invalidity"; } + // ValidatorShardIndices + rpc ValidatorShardIndices(QueryValidatorShardIndicesRequest) returns (QueryValidatorShardIndicesResponse) { + option (google.api.http).get = "/sunrise/v1/da/validator-shard-indices"; + } // ZkpProofThreshold rpc ZkpProofThreshold(QueryZkpProofThresholdRequest) returns (QueryZkpProofThresholdResponse) { option (google.api.http).get = "/sunrise/v1/da/zkp-proof-threshold"; @@ -134,6 +138,19 @@ message QueryAllInvalidityResponse { repeated Invalidity invalidity = 1 [(gogoproto.nullable) = false]; } +// QueryValidatorShardIndicesRequest is request type for the +// Query/ValidatorShardIndices RPC method. +message QueryValidatorShardIndicesRequest { + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + uint64 shard_count = 2; +} + +// QueryValidatorShardIndicesResponse is response type for the +// Query/ValidatorShardIndices RPC method. +message QueryValidatorShardIndicesResponse { + repeated uint64 shard_indices = 1; +} + // QueryZkpProofThresholdRequest is request type for the // Query/ZkpProofThreshold RPC method. message QueryZkpProofThresholdRequest { @@ -143,7 +160,7 @@ message QueryZkpProofThresholdRequest { // QueryZkpProofThresholdResponse is response type for the // Query/ZkpProofThreshold RPC method. message QueryZkpProofThresholdResponse { - uint64 threshold = 2 [(amino.dont_omitempty) = true]; + uint64 threshold = 1 [(amino.dont_omitempty) = true]; } // QueryProofDeputyRequest is request type for the diff --git a/x/da/keeper/msg_server_submit_validity_proof.go b/x/da/keeper/msg_server_submit_validity_proof.go index eaf657fe..74c69dcc 100644 --- a/x/da/keeper/msg_server_submit_validity_proof.go +++ b/x/da/keeper/msg_server_submit_validity_proof.go @@ -27,10 +27,13 @@ func (k msgServer) SubmitValidityProof(ctx context.Context, msg *types.MsgSubmit return nil, errorsmod.Wrap(err, "invalid validator address") } valAddr := sdk.ValAddress(validator) - _, err = k.StakingKeeper.Validator(ctx, valAddr) + sdkVal, err := k.StakingKeeper.Validator(ctx, valAddr) if err != nil { return nil, errorsmod.Wrap(err, "validator not exists") } + if !sdkVal.IsBonded() { + return nil, types.ErrValidatorNotBonded + } if !bytes.Equal(sender, validator) { deputy, found, err := k.GetProofDeputy(ctx, validator) if err != nil { diff --git a/x/da/keeper/query_da.go b/x/da/keeper/query_da.go index 30400429..fca33d50 100644 --- a/x/da/keeper/query_da.go +++ b/x/da/keeper/query_da.go @@ -39,6 +39,28 @@ func (q queryServer) AllPublishedData(goCtx context.Context, req *types.QueryAll return &types.QueryAllPublishedDataResponse{Data: data}, nil } +func (q queryServer) ValidatorShardIndices(goCtx context.Context, req *types.QueryValidatorShardIndicesRequest) (*types.QueryValidatorShardIndicesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + validator, err := q.k.validatorAddressCodec.StringToBytes(req.ValidatorAddress) + if err != nil { + return nil, errorsmod.Wrap(err, "invalid validator address") + } + threshold, err := q.k.GetZkpThreshold(ctx, req.ShardCount) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + indices := types.ShardIndicesForValidator(validator, int64(threshold), int64(req.ShardCount)) + shardIndices := make([]uint64, len(indices)) + for i, index := range indices { + shardIndices[i] = uint64(index) + } + return &types.QueryValidatorShardIndicesResponse{ShardIndices: shardIndices}, nil +} + func (q queryServer) ZkpProofThreshold(goCtx context.Context, req *types.QueryZkpProofThresholdRequest) (*types.QueryZkpProofThresholdResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") diff --git a/x/da/types/errors.go b/x/da/types/errors.go index 41de48cb..3b9614d8 100644 --- a/x/da/types/errors.go +++ b/x/da/types/errors.go @@ -23,4 +23,5 @@ var ( ErrInvalidDeputy = errors.Register(ModuleName, 1112, "invalid proof deputy") ErrProofNotFound = errors.Register(ModuleName, 1113, "validity proof not found") ErrInvalidityNotFound = errors.Register(ModuleName, 1114, "invalidity not found") + ErrValidatorNotBonded = errors.Register(ModuleName, 1115, "validator is not bonded") ) diff --git a/x/da/types/query.pb.go b/x/da/types/query.pb.go index aa9859e5..41bbb78c 100644 --- a/x/da/types/query.pb.go +++ b/x/da/types/query.pb.go @@ -674,6 +674,114 @@ func (m *QueryAllInvalidityResponse) GetInvalidity() []Invalidity { return nil } +// QueryValidatorShardIndicesRequest is request type for the +// Query/ValidatorShardIndices RPC method. +type QueryValidatorShardIndicesRequest struct { + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ShardCount uint64 `protobuf:"varint,2,opt,name=shard_count,json=shardCount,proto3" json:"shard_count,omitempty"` +} + +func (m *QueryValidatorShardIndicesRequest) Reset() { *m = QueryValidatorShardIndicesRequest{} } +func (m *QueryValidatorShardIndicesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorShardIndicesRequest) ProtoMessage() {} +func (*QueryValidatorShardIndicesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f44cb6d19e9f9d9d, []int{14} +} +func (m *QueryValidatorShardIndicesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorShardIndicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorShardIndicesRequest.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 *QueryValidatorShardIndicesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorShardIndicesRequest.Merge(m, src) +} +func (m *QueryValidatorShardIndicesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorShardIndicesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorShardIndicesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorShardIndicesRequest proto.InternalMessageInfo + +func (m *QueryValidatorShardIndicesRequest) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +func (m *QueryValidatorShardIndicesRequest) GetShardCount() uint64 { + if m != nil { + return m.ShardCount + } + return 0 +} + +// QueryValidatorShardIndicesResponse is response type for the +// Query/ValidatorShardIndices RPC method. +type QueryValidatorShardIndicesResponse struct { + ShardIndices []uint64 `protobuf:"varint,1,rep,packed,name=shard_indices,json=shardIndices,proto3" json:"shard_indices,omitempty"` + ShardCount uint64 `protobuf:"varint,2,opt,name=shard_count,json=shardCount,proto3" json:"shard_count,omitempty"` +} + +func (m *QueryValidatorShardIndicesResponse) Reset() { *m = QueryValidatorShardIndicesResponse{} } +func (m *QueryValidatorShardIndicesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorShardIndicesResponse) ProtoMessage() {} +func (*QueryValidatorShardIndicesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f44cb6d19e9f9d9d, []int{15} +} +func (m *QueryValidatorShardIndicesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorShardIndicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorShardIndicesResponse.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 *QueryValidatorShardIndicesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorShardIndicesResponse.Merge(m, src) +} +func (m *QueryValidatorShardIndicesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorShardIndicesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorShardIndicesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorShardIndicesResponse proto.InternalMessageInfo + +func (m *QueryValidatorShardIndicesResponse) GetShardIndices() []uint64 { + if m != nil { + return m.ShardIndices + } + return nil +} + +func (m *QueryValidatorShardIndicesResponse) GetShardCount() uint64 { + if m != nil { + return m.ShardCount + } + return 0 +} + // QueryZkpProofThresholdRequest is request type for the // Query/ZkpProofThreshold RPC method. type QueryZkpProofThresholdRequest struct { @@ -684,7 +792,7 @@ func (m *QueryZkpProofThresholdRequest) Reset() { *m = QueryZkpProofThre func (m *QueryZkpProofThresholdRequest) String() string { return proto.CompactTextString(m) } func (*QueryZkpProofThresholdRequest) ProtoMessage() {} func (*QueryZkpProofThresholdRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f44cb6d19e9f9d9d, []int{14} + return fileDescriptor_f44cb6d19e9f9d9d, []int{16} } func (m *QueryZkpProofThresholdRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -723,14 +831,14 @@ func (m *QueryZkpProofThresholdRequest) GetShardCount() uint64 { // QueryZkpProofThresholdResponse is response type for the // Query/ZkpProofThreshold RPC method. type QueryZkpProofThresholdResponse struct { - Threshold uint64 `protobuf:"varint,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + Threshold uint64 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` } func (m *QueryZkpProofThresholdResponse) Reset() { *m = QueryZkpProofThresholdResponse{} } func (m *QueryZkpProofThresholdResponse) String() string { return proto.CompactTextString(m) } func (*QueryZkpProofThresholdResponse) ProtoMessage() {} func (*QueryZkpProofThresholdResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f44cb6d19e9f9d9d, []int{15} + return fileDescriptor_f44cb6d19e9f9d9d, []int{17} } func (m *QueryZkpProofThresholdResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -776,7 +884,7 @@ func (m *QueryProofDeputyRequest) Reset() { *m = QueryProofDeputyRequest func (m *QueryProofDeputyRequest) String() string { return proto.CompactTextString(m) } func (*QueryProofDeputyRequest) ProtoMessage() {} func (*QueryProofDeputyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f44cb6d19e9f9d9d, []int{16} + return fileDescriptor_f44cb6d19e9f9d9d, []int{18} } func (m *QueryProofDeputyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -822,7 +930,7 @@ func (m *QueryProofDeputyResponse) Reset() { *m = QueryProofDeputyRespon func (m *QueryProofDeputyResponse) String() string { return proto.CompactTextString(m) } func (*QueryProofDeputyResponse) ProtoMessage() {} func (*QueryProofDeputyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f44cb6d19e9f9d9d, []int{17} + return fileDescriptor_f44cb6d19e9f9d9d, []int{19} } func (m *QueryProofDeputyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -873,6 +981,8 @@ func init() { proto.RegisterType((*QueryInvalidityResponse)(nil), "sunrise.da.v1.QueryInvalidityResponse") proto.RegisterType((*QueryAllInvalidityRequest)(nil), "sunrise.da.v1.QueryAllInvalidityRequest") proto.RegisterType((*QueryAllInvalidityResponse)(nil), "sunrise.da.v1.QueryAllInvalidityResponse") + proto.RegisterType((*QueryValidatorShardIndicesRequest)(nil), "sunrise.da.v1.QueryValidatorShardIndicesRequest") + proto.RegisterType((*QueryValidatorShardIndicesResponse)(nil), "sunrise.da.v1.QueryValidatorShardIndicesResponse") proto.RegisterType((*QueryZkpProofThresholdRequest)(nil), "sunrise.da.v1.QueryZkpProofThresholdRequest") proto.RegisterType((*QueryZkpProofThresholdResponse)(nil), "sunrise.da.v1.QueryZkpProofThresholdResponse") proto.RegisterType((*QueryProofDeputyRequest)(nil), "sunrise.da.v1.QueryProofDeputyRequest") @@ -882,66 +992,71 @@ func init() { func init() { proto.RegisterFile("sunrise/da/v1/query.proto", fileDescriptor_f44cb6d19e9f9d9d) } var fileDescriptor_f44cb6d19e9f9d9d = []byte{ - // 931 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xb6, 0x49, 0xa4, 0x4c, 0x48, 0xd5, 0x0c, 0x29, 0x8d, 0xb7, 0xf1, 0x06, 0x4f, 0x28, - 0xb4, 0x01, 0x7b, 0x49, 0x90, 0x10, 0x27, 0x4a, 0x4c, 0x38, 0x70, 0x29, 0xc5, 0x94, 0x22, 0x05, - 0x21, 0x6b, 0x92, 0x5d, 0xec, 0x55, 0xd7, 0x3b, 0xdb, 0x9d, 0x5d, 0x0b, 0x23, 0x84, 0x10, 0x1c, - 0x91, 0x10, 0x12, 0x17, 0x0e, 0xfc, 0x00, 0x8e, 0x1c, 0xfa, 0x23, 0x7a, 0xac, 0xca, 0x85, 0x13, - 0x42, 0x09, 0x12, 0x7f, 0x03, 0xcd, 0xcc, 0x5b, 0xdb, 0x3b, 0x3b, 0x9b, 0xda, 0xb9, 0x54, 0xf5, - 0x9b, 0xef, 0xbd, 0xf7, 0xbd, 0xef, 0xcd, 0x7c, 0x1b, 0x54, 0xe3, 0x59, 0x94, 0x04, 0xdc, 0x77, - 0x3d, 0xea, 0x0e, 0xf7, 0xdc, 0x47, 0x99, 0x9f, 0x8c, 0x5a, 0x71, 0xc2, 0x52, 0x86, 0xd7, 0xe0, - 0xa8, 0xe5, 0xd1, 0xd6, 0x70, 0xcf, 0x5e, 0xa7, 0x83, 0x20, 0x62, 0xae, 0xfc, 0x57, 0x21, 0xec, - 0xda, 0x09, 0xe3, 0x03, 0xc6, 0xbb, 0xf2, 0x97, 0xab, 0x7e, 0xc0, 0xd1, 0x46, 0x8f, 0xf5, 0x98, - 0x8a, 0x8b, 0xff, 0x41, 0x74, 0xab, 0xc7, 0x58, 0x2f, 0xf4, 0x5d, 0x1a, 0x07, 0x2e, 0x8d, 0x22, - 0x96, 0xd2, 0x34, 0x60, 0x51, 0x9e, 0x63, 0x17, 0xb9, 0xc4, 0x34, 0xa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xfa, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x98, 0xfc, 0x54, 0xf0, 0xd8, - 0x0b, 0x00, 0x00, + // 1021 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xb6, 0x49, 0xa4, 0x8c, 0x9b, 0xaa, 0x19, 0x12, 0x1a, 0x6f, 0x63, 0x07, 0x4f, 0x68, + 0x49, 0x03, 0x6b, 0x37, 0x41, 0x42, 0x9c, 0x28, 0x31, 0xe1, 0xd0, 0x4b, 0x29, 0x6e, 0x29, 0x52, + 0x10, 0xb2, 0x26, 0xd9, 0xc5, 0x5e, 0xba, 0xde, 0xd9, 0xee, 0xac, 0x2d, 0x82, 0x10, 0x07, 0x38, + 0x22, 0x21, 0x24, 0x38, 0x70, 0xe0, 0x07, 0x70, 0x40, 0x82, 0x43, 0x7f, 0x44, 0x8f, 0x55, 0xb9, + 0x70, 0x42, 0x28, 0x41, 0xe2, 0x6f, 0xa0, 0x99, 0x79, 0x6b, 0x7b, 0x67, 0x67, 0x13, 0x3b, 0xea, + 0x25, 0xca, 0xbe, 0xf9, 0xde, 0x7b, 0xdf, 0x7b, 0xf3, 0xcd, 0x7b, 0x32, 0x2a, 0xf3, 0x7e, 0x18, + 0xfb, 0xdc, 0x6b, 0xb8, 0xb4, 0x31, 0xd8, 0x6e, 0x3c, 0xee, 0x7b, 0xf1, 0x51, 0x3d, 0x8a, 0x59, + 0xc2, 0xf0, 0x22, 0x1c, 0xd5, 0x5d, 0x5a, 0x1f, 0x6c, 0xdb, 0x4b, 0xb4, 0xe7, 0x87, 0xac, 0x21, + 0xff, 0x2a, 0x84, 0x5d, 0x3e, 0x64, 0xbc, 0xc7, 0x78, 0x5b, 0x7e, 0x35, 0xd4, 0x07, 0x1c, 0x2d, + 0x77, 0x58, 0x87, 0x29, 0xbb, 0xf8, 0x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0e, 0xac, 0x04, + 0xa9, 0xad, 0xdc, 0x5c, 0x36, 0x6b, 0xab, 0x68, 0x01, 0x98, 0xb5, 0x55, 0x38, 0xec, 0x0b, 0xb5, + 0xf5, 0xe5, 0xa3, 0x48, 0x49, 0xca, 0x19, 0xce, 0x7c, 0xfc, 0xad, 0x85, 0x4a, 0x63, 0x43, 0x18, + 0x1b, 0x65, 0x93, 0x5f, 0x08, 0xf6, 0x6b, 0x67, 0xe2, 0x80, 0xcc, 0x86, 0x24, 0x53, 0xc1, 0xd7, + 0xf4, 0x59, 0x25, 0x89, 0xa8, 0xc1, 0xdd, 0xdc, 0x7b, 0x7a, 0x5c, 0xb5, 0x9e, 0x1d, 0x57, 0xad, + 0x7f, 0x8e, 0xab, 0xd6, 0x0f, 0x27, 0xd5, 0x99, 0x67, 0x27, 0xd5, 0x99, 0xbf, 0x4e, 0xaa, 0x33, + 0xfb, 0x5b, 0x1d, 0x3f, 0xe9, 0xf6, 0x0f, 0xea, 0x87, 0xac, 0x97, 0x06, 0x08, 0xe8, 0x91, 0x17, + 0x0f, 0xa3, 0x7d, 0x21, 0x82, 0x25, 0x47, 0x91, 0xc7, 0x0f, 0xe6, 0xe5, 0x8f, 0x97, 0x37, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0xff, 0x0f, 0xd9, 0x2b, 0x3b, 0x8a, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -970,6 +1085,8 @@ type QueryClient interface { Invalidity(ctx context.Context, in *QueryInvalidityRequest, opts ...grpc.CallOption) (*QueryInvalidityResponse, error) // AllInvalidity queries all invalidity reports AllInvalidity(ctx context.Context, in *QueryAllInvalidityRequest, opts ...grpc.CallOption) (*QueryAllInvalidityResponse, error) + // ValidatorShardIndices + ValidatorShardIndices(ctx context.Context, in *QueryValidatorShardIndicesRequest, opts ...grpc.CallOption) (*QueryValidatorShardIndicesResponse, error) // ZkpProofThreshold ZkpProofThreshold(ctx context.Context, in *QueryZkpProofThresholdRequest, opts ...grpc.CallOption) (*QueryZkpProofThresholdResponse, error) // ProofDeputy @@ -1047,6 +1164,15 @@ func (c *queryClient) AllInvalidity(ctx context.Context, in *QueryAllInvalidityR return out, nil } +func (c *queryClient) ValidatorShardIndices(ctx context.Context, in *QueryValidatorShardIndicesRequest, opts ...grpc.CallOption) (*QueryValidatorShardIndicesResponse, error) { + out := new(QueryValidatorShardIndicesResponse) + err := c.cc.Invoke(ctx, "/sunrise.da.v1.Query/ValidatorShardIndices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) ZkpProofThreshold(ctx context.Context, in *QueryZkpProofThresholdRequest, opts ...grpc.CallOption) (*QueryZkpProofThresholdResponse, error) { out := new(QueryZkpProofThresholdResponse) err := c.cc.Invoke(ctx, "/sunrise.da.v1.Query/ZkpProofThreshold", in, out, opts...) @@ -1081,6 +1207,8 @@ type QueryServer interface { Invalidity(context.Context, *QueryInvalidityRequest) (*QueryInvalidityResponse, error) // AllInvalidity queries all invalidity reports AllInvalidity(context.Context, *QueryAllInvalidityRequest) (*QueryAllInvalidityResponse, error) + // ValidatorShardIndices + ValidatorShardIndices(context.Context, *QueryValidatorShardIndicesRequest) (*QueryValidatorShardIndicesResponse, error) // ZkpProofThreshold ZkpProofThreshold(context.Context, *QueryZkpProofThresholdRequest) (*QueryZkpProofThresholdResponse, error) // ProofDeputy @@ -1112,6 +1240,9 @@ func (*UnimplementedQueryServer) Invalidity(ctx context.Context, req *QueryInval func (*UnimplementedQueryServer) AllInvalidity(ctx context.Context, req *QueryAllInvalidityRequest) (*QueryAllInvalidityResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllInvalidity not implemented") } +func (*UnimplementedQueryServer) ValidatorShardIndices(ctx context.Context, req *QueryValidatorShardIndicesRequest) (*QueryValidatorShardIndicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorShardIndices not implemented") +} func (*UnimplementedQueryServer) ZkpProofThreshold(ctx context.Context, req *QueryZkpProofThresholdRequest) (*QueryZkpProofThresholdResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ZkpProofThreshold not implemented") } @@ -1249,6 +1380,24 @@ func _Query_AllInvalidity_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_ValidatorShardIndices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorShardIndicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorShardIndices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sunrise.da.v1.Query/ValidatorShardIndices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorShardIndices(ctx, req.(*QueryValidatorShardIndicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_ZkpProofThreshold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryZkpProofThresholdRequest) if err := dec(in); err != nil { @@ -1318,6 +1467,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllInvalidity", Handler: _Query_AllInvalidity_Handler, }, + { + MethodName: "ValidatorShardIndices", + Handler: _Query_ValidatorShardIndices_Handler, + }, { MethodName: "ZkpProofThreshold", Handler: _Query_ZkpProofThreshold_Handler, @@ -1784,6 +1937,87 @@ func (m *QueryAllInvalidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *QueryValidatorShardIndicesRequest) 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 *QueryValidatorShardIndicesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorShardIndicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ShardCount != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ShardCount)) + i-- + dAtA[i] = 0x10 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorShardIndicesResponse) 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 *QueryValidatorShardIndicesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorShardIndicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ShardCount != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ShardCount)) + i-- + dAtA[i] = 0x10 + } + if len(m.ShardIndices) > 0 { + dAtA6 := make([]byte, len(m.ShardIndices)*10) + var j5 int + for _, num := range m.ShardIndices { + for num >= 1<<7 { + dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j5++ + } + dAtA6[j5] = uint8(num) + j5++ + } + i -= j5 + copy(dAtA[i:], dAtA6[:j5]) + i = encodeVarintQuery(dAtA, i, uint64(j5)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryZkpProofThresholdRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1835,7 +2069,7 @@ func (m *QueryZkpProofThresholdResponse) MarshalToSizedBuffer(dAtA []byte) (int, if m.Threshold != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Threshold)) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -2091,6 +2325,41 @@ func (m *QueryAllInvalidityResponse) Size() (n int) { return n } +func (m *QueryValidatorShardIndicesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ShardCount != 0 { + n += 1 + sovQuery(uint64(m.ShardCount)) + } + return n +} + +func (m *QueryValidatorShardIndicesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ShardIndices) > 0 { + l = 0 + for _, e := range m.ShardIndices { + l += sovQuery(uint64(e)) + } + n += 1 + sovQuery(uint64(l)) + l + } + if m.ShardCount != 0 { + n += 1 + sovQuery(uint64(m.ShardCount)) + } + return n +} + func (m *QueryZkpProofThresholdRequest) Size() (n int) { if m == nil { return 0 @@ -3305,6 +3574,252 @@ func (m *QueryAllInvalidityResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryValidatorShardIndicesRequest) 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: QueryValidatorShardIndicesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorShardIndicesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardCount", wireType) + } + m.ShardCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ShardCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *QueryValidatorShardIndicesResponse) 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: QueryValidatorShardIndicesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorShardIndicesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ShardIndices = append(m.ShardIndices, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ShardIndices) == 0 { + m.ShardIndices = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ShardIndices = append(m.ShardIndices, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field ShardIndices", wireType) + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardCount", wireType) + } + m.ShardCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ShardCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *QueryZkpProofThresholdRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3403,7 +3918,7 @@ func (m *QueryZkpProofThresholdResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryZkpProofThresholdResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) } diff --git a/x/da/types/query.pb.gw.go b/x/da/types/query.pb.gw.go index c0a3d075..0eba6b3d 100644 --- a/x/da/types/query.pb.gw.go +++ b/x/da/types/query.pb.gw.go @@ -249,6 +249,42 @@ func local_request_Query_AllInvalidity_0(ctx context.Context, marshaler runtime. } +var ( + filter_Query_ValidatorShardIndices_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ValidatorShardIndices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorShardIndicesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorShardIndices_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ValidatorShardIndices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorShardIndices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorShardIndicesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorShardIndices_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ValidatorShardIndices(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_ZkpProofThreshold_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -488,6 +524,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ValidatorShardIndices_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_ValidatorShardIndices_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_ValidatorShardIndices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ZkpProofThreshold_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -715,6 +774,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ValidatorShardIndices_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_ValidatorShardIndices_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_ValidatorShardIndices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ZkpProofThreshold_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -773,6 +852,8 @@ var ( pattern_Query_AllInvalidity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sunrise", "v1", "da", "all-invalidity"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ValidatorShardIndices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sunrise", "v1", "da", "validator-shard-indices"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ZkpProofThreshold_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sunrise", "v1", "da", "zkp-proof-threshold"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ProofDeputy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sunrise", "v1", "da", "proof-deputy"}, "", runtime.AssumeColonVerbOpt(false))) @@ -793,6 +874,8 @@ var ( forward_Query_AllInvalidity_0 = runtime.ForwardResponseMessage + forward_Query_ValidatorShardIndices_0 = runtime.ForwardResponseMessage + forward_Query_ZkpProofThreshold_0 = runtime.ForwardResponseMessage forward_Query_ProofDeputy_0 = runtime.ForwardResponseMessage