From cfd10a04731a445f5ddbb87af4b7702818e2de97 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Tue, 25 Apr 2023 14:02:19 +0530 Subject: [PATCH 01/21] new proto files --- proto/babylon/zoneconcierge/v1/query.proto | 14 + x/zoneconcierge/keeper/grpc_query.go | 24 +- x/zoneconcierge/types/query.pb.go | 549 ++++++++++++++++++--- x/zoneconcierge/types/query.pb.gw.go | 83 ++++ 4 files changed, 591 insertions(+), 79 deletions(-) diff --git a/proto/babylon/zoneconcierge/v1/query.proto b/proto/babylon/zoneconcierge/v1/query.proto index 06a0d4b27..0b786044e 100644 --- a/proto/babylon/zoneconcierge/v1/query.proto +++ b/proto/babylon/zoneconcierge/v1/query.proto @@ -26,6 +26,11 @@ service Query { option (google.api.http).get = "/babylon/zoneconcierge/v1/chain_info/{chain_id}"; } + // ChainsInfo queries the latest info of given chains in Babylon's view + rpc ChainsInfo(QueryChainsInfoRequest) returns (QueryChainsInfoResponse) { + option (google.api.http).get = + "/babylon/zoneconcierge/v1/chains_info"; + } // EpochChainInfo queries the latest info of a chain in a given epoch of // Babylon's view rpc EpochChainInfo(QueryEpochChainInfoRequest) @@ -97,6 +102,15 @@ message QueryChainInfoResponse { babylon.zoneconcierge.v1.ChainInfo chain_info = 1; } +// QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. +message QueryChainsInfoRequest { string chain_id = 1; } + +// QueryChainsInfoResponse is response type for the Query/ChainInfo RPC method. +message QueryChainsInfoResponse { + // chain_info is the info of the CZ + babylon.zoneconcierge.v1.ChainInfo chain_info = 1; +} + // QueryEpochChainInfoRequest is request type for the Query/EpochChainInfo RPC // method. message QueryEpochChainInfoRequest { diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index e1aac72ff..8b8c112b1 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -3,11 +3,12 @@ package keeper import ( "context" - "github.com/babylonchain/babylon/x/zoneconcierge/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "github.com/babylonchain/babylon/x/zoneconcierge/types" ) var _ types.QueryServer = Keeper{} @@ -58,6 +59,27 @@ func (k Keeper) ChainInfo(c context.Context, req *types.QueryChainInfoRequest) ( return resp, nil } +// ChainsInfo returns the latest info of chains with given IDs +func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) (*types.QueryChainsInfoResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if len(req.ChainId) == 0 { + return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") + } + + ctx := sdk.UnwrapSDKContext(c) + + // find the chain info of this epoch + chainInfo, err := k.GetChainInfo(ctx, req.ChainId) + if err != nil { + return nil, err + } + resp := &types.QueryChainsInfoResponse{ChainInfo: chainInfo} + return resp, nil +} + // Header returns the header and fork headers at a given height func (k Keeper) Header(c context.Context, req *types.QueryHeaderRequest) (*types.QueryHeaderResponse, error) { if req == nil { diff --git a/x/zoneconcierge/types/query.pb.go b/x/zoneconcierge/types/query.pb.go index 9841ea276..faa152bce 100644 --- a/x/zoneconcierge/types/query.pb.go +++ b/x/zoneconcierge/types/query.pb.go @@ -330,6 +330,97 @@ func (m *QueryChainInfoResponse) GetChainInfo() *ChainInfo { return nil } +// QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. +type QueryChainsInfoRequest struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryChainsInfoRequest) Reset() { *m = QueryChainsInfoRequest{} } +func (m *QueryChainsInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryChainsInfoRequest) ProtoMessage() {} +func (*QueryChainsInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cd665af90102da38, []int{6} +} +func (m *QueryChainsInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChainsInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChainsInfoRequest.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 *QueryChainsInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChainsInfoRequest.Merge(m, src) +} +func (m *QueryChainsInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryChainsInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChainsInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChainsInfoRequest proto.InternalMessageInfo + +func (m *QueryChainsInfoRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +// QueryChainsInfoResponse is response type for the Query/ChainInfo RPC method. +type QueryChainsInfoResponse struct { + // chain_info is the info of the CZ + ChainInfo *ChainInfo `protobuf:"bytes,1,opt,name=chain_info,json=chainInfo,proto3" json:"chain_info,omitempty"` +} + +func (m *QueryChainsInfoResponse) Reset() { *m = QueryChainsInfoResponse{} } +func (m *QueryChainsInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryChainsInfoResponse) ProtoMessage() {} +func (*QueryChainsInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cd665af90102da38, []int{7} +} +func (m *QueryChainsInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChainsInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChainsInfoResponse.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 *QueryChainsInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChainsInfoResponse.Merge(m, src) +} +func (m *QueryChainsInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryChainsInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChainsInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChainsInfoResponse proto.InternalMessageInfo + +func (m *QueryChainsInfoResponse) GetChainInfo() *ChainInfo { + if m != nil { + return m.ChainInfo + } + return nil +} + // QueryEpochChainInfoRequest is request type for the Query/EpochChainInfo RPC // method. type QueryEpochChainInfoRequest struct { @@ -341,7 +432,7 @@ func (m *QueryEpochChainInfoRequest) Reset() { *m = QueryEpochChainInfoR func (m *QueryEpochChainInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryEpochChainInfoRequest) ProtoMessage() {} func (*QueryEpochChainInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{6} + return fileDescriptor_cd665af90102da38, []int{8} } func (m *QueryEpochChainInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -395,7 +486,7 @@ func (m *QueryEpochChainInfoResponse) Reset() { *m = QueryEpochChainInfo func (m *QueryEpochChainInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryEpochChainInfoResponse) ProtoMessage() {} func (*QueryEpochChainInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{7} + return fileDescriptor_cd665af90102da38, []int{9} } func (m *QueryEpochChainInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -442,7 +533,7 @@ func (m *QueryListHeadersRequest) Reset() { *m = QueryListHeadersRequest func (m *QueryListHeadersRequest) String() string { return proto.CompactTextString(m) } func (*QueryListHeadersRequest) ProtoMessage() {} func (*QueryListHeadersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{8} + return fileDescriptor_cd665af90102da38, []int{10} } func (m *QueryListHeadersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +589,7 @@ func (m *QueryListHeadersResponse) Reset() { *m = QueryListHeadersRespon func (m *QueryListHeadersResponse) String() string { return proto.CompactTextString(m) } func (*QueryListHeadersResponse) ProtoMessage() {} func (*QueryListHeadersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{9} + return fileDescriptor_cd665af90102da38, []int{11} } func (m *QueryListHeadersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -552,7 +643,7 @@ func (m *QueryListEpochHeadersRequest) Reset() { *m = QueryListEpochHead func (m *QueryListEpochHeadersRequest) String() string { return proto.CompactTextString(m) } func (*QueryListEpochHeadersRequest) ProtoMessage() {} func (*QueryListEpochHeadersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{10} + return fileDescriptor_cd665af90102da38, []int{12} } func (m *QueryListEpochHeadersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -606,7 +697,7 @@ func (m *QueryListEpochHeadersResponse) Reset() { *m = QueryListEpochHea func (m *QueryListEpochHeadersResponse) String() string { return proto.CompactTextString(m) } func (*QueryListEpochHeadersResponse) ProtoMessage() {} func (*QueryListEpochHeadersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{11} + return fileDescriptor_cd665af90102da38, []int{13} } func (m *QueryListEpochHeadersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -655,7 +746,7 @@ func (m *QueryFinalizedChainInfoRequest) Reset() { *m = QueryFinalizedCh func (m *QueryFinalizedChainInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryFinalizedChainInfoRequest) ProtoMessage() {} func (*QueryFinalizedChainInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{12} + return fileDescriptor_cd665af90102da38, []int{14} } func (m *QueryFinalizedChainInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -718,7 +809,7 @@ func (m *QueryFinalizedChainInfoResponse) Reset() { *m = QueryFinalizedC func (m *QueryFinalizedChainInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryFinalizedChainInfoResponse) ProtoMessage() {} func (*QueryFinalizedChainInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{13} + return fileDescriptor_cd665af90102da38, []int{15} } func (m *QueryFinalizedChainInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -803,7 +894,7 @@ func (m *QueryFinalizedChainInfoUntilHeightRequest) String() string { } func (*QueryFinalizedChainInfoUntilHeightRequest) ProtoMessage() {} func (*QueryFinalizedChainInfoUntilHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{14} + return fileDescriptor_cd665af90102da38, []int{16} } func (m *QueryFinalizedChainInfoUntilHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -877,7 +968,7 @@ func (m *QueryFinalizedChainInfoUntilHeightResponse) String() string { } func (*QueryFinalizedChainInfoUntilHeightResponse) ProtoMessage() {} func (*QueryFinalizedChainInfoUntilHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{15} + return fileDescriptor_cd665af90102da38, []int{17} } func (m *QueryFinalizedChainInfoUntilHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -948,6 +1039,8 @@ func init() { proto.RegisterType((*QueryChainListResponse)(nil), "babylon.zoneconcierge.v1.QueryChainListResponse") proto.RegisterType((*QueryChainInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryChainInfoRequest") proto.RegisterType((*QueryChainInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryChainInfoResponse") + proto.RegisterType((*QueryChainsInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryChainsInfoRequest") + proto.RegisterType((*QueryChainsInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryChainsInfoResponse") proto.RegisterType((*QueryEpochChainInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryEpochChainInfoRequest") proto.RegisterType((*QueryEpochChainInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryEpochChainInfoResponse") proto.RegisterType((*QueryListHeadersRequest)(nil), "babylon.zoneconcierge.v1.QueryListHeadersRequest") @@ -965,74 +1058,77 @@ func init() { } var fileDescriptor_cd665af90102da38 = []byte{ - // 1071 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xef, 0xc6, 0x49, 0x1a, 0xbf, 0x94, 0xaa, 0x1a, 0x4a, 0x31, 0x9b, 0xd6, 0x8d, 0x16, 0x04, - 0x69, 0x15, 0x76, 0x59, 0xd3, 0x52, 0x22, 0x0e, 0x55, 0x92, 0x92, 0x34, 0x14, 0x95, 0x66, 0x21, - 0x1c, 0x10, 0x92, 0xb5, 0xbb, 0x1e, 0xdb, 0xab, 0xc4, 0x33, 0xee, 0xce, 0xda, 0xad, 0x1b, 0xc2, - 0x81, 0x4f, 0x80, 0x04, 0x07, 0xc4, 0x15, 0x09, 0x24, 0x0e, 0xfd, 0x1c, 0x20, 0xf5, 0x50, 0x89, - 0x0b, 0x47, 0x94, 0xf0, 0x35, 0x90, 0xd0, 0xce, 0xcc, 0xae, 0x77, 0xbd, 0x5e, 0xfc, 0x87, 0x1c, - 0x38, 0x70, 0xf3, 0xcc, 0xbe, 0xf7, 0x7b, 0xbf, 0xf7, 0x67, 0xde, 0x7b, 0x86, 0xd7, 0x1c, 0xdb, - 0xe9, 0x1d, 0x50, 0x62, 0x3c, 0xa1, 0x04, 0xbb, 0x94, 0xb8, 0x1e, 0xf6, 0x1b, 0xd8, 0xe8, 0x9a, - 0xc6, 0xc3, 0x0e, 0xf6, 0x7b, 0x7a, 0xdb, 0xa7, 0x01, 0x45, 0x25, 0x29, 0xa5, 0xa7, 0xa4, 0xf4, - 0xae, 0xa9, 0x5e, 0x6e, 0x50, 0xda, 0x38, 0xc0, 0x86, 0xdd, 0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 0xba, 0x10, 0x00, 0x00, + // 1115 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0x49, 0x1a, 0xbf, 0xd0, 0xaa, 0x1a, 0x4a, 0x31, 0x9b, 0xd6, 0x8d, 0x96, 0x3f, + 0x4d, 0xab, 0x74, 0x17, 0xbb, 0x2d, 0x25, 0xe2, 0x50, 0x25, 0x29, 0x49, 0x43, 0x51, 0x69, 0x16, + 0xc2, 0x01, 0x81, 0xac, 0xdd, 0xf5, 0xd8, 0x5e, 0x25, 0x9e, 0x71, 0x3d, 0x6b, 0xb7, 0x6e, 0x08, + 0x07, 0x3e, 0x01, 0x12, 0x17, 0xc4, 0x09, 0x09, 0x09, 0x24, 0x0e, 0xbd, 0xf2, 0x15, 0x40, 0xea, + 0xa1, 0x12, 0x17, 0x8e, 0x28, 0xe1, 0x6b, 0x20, 0xa1, 0x9d, 0x99, 0xb5, 0x77, 0xbd, 0x5e, 0xbc, + 0x6b, 0x72, 0xe0, 0xc0, 0xcd, 0x33, 0xfb, 0xde, 0xef, 0xfd, 0xde, 0xef, 0xbd, 0x99, 0x79, 0x32, + 0xbc, 0x66, 0x5b, 0x76, 0x6f, 0x9f, 0x12, 0xe3, 0x09, 0x25, 0xd8, 0xa1, 0xc4, 0x71, 0x71, 0xbb, + 0x8e, 0x8d, 0x6e, 0xc9, 0x78, 0xd8, 0xc1, 0xed, 0x9e, 0xde, 0x6a, 0x53, 0x8f, 0xa2, 0x82, 0xb4, + 0xd2, 0x23, 0x56, 0x7a, 0xb7, 0xa4, 0x5e, 0xa8, 0x53, 0x5a, 0xdf, 0xc7, 0x86, 0xd5, 0x72, 0x0d, + 0x8b, 0x10, 0xea, 0x59, 0x9e, 0x4b, 0x09, 0x13, 0x7e, 0xea, 0x55, 0x87, 0xb2, 0x26, 0x65, 0x86,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6d, 0xc3, 0x4f, 0xe2, 0x7d, 0x97, 0x79, 0x41, 0xa2, 0x9b, 0x00, + 0x83, 0xea, 0x49, 0x86, 0x6f, 0xe8, 0xa2, 0xd4, 0xba, 0x5f, 0x6a, 0x5d, 0xf4, 0x8e, 0x2c, 0xb5, + 0xfe, 0xc0, 0xaa, 0x63, 0xe9, 0x6b, 0x86, 0x3c, 0xb5, 0x2f, 0xe0, 0xfc, 0x70, 0x00, 0x99, 0xff, + 0x22, 0xe4, 0x03, 0x29, 0x59, 0x41, 0x59, 0xca, 0x2d, 0xe7, 0xcd, 0x79, 0xa9, 0x25, 0x43, 0x5b, + 0x91, 0xf0, 0xd3, 0x52, 0xa0, 0x71, 0xe1, 0x05, 0x72, 0x24, 0x7e, 0x39, 0x9c, 0xe0, 0x36, 0xa9, + 0xd1, 0xf1, 0x95, 0xd4, 0x3e, 0x0d, 0x73, 0x16, 0x3e, 0x92, 0xf3, 0x3a, 0x80, 0x74, 0x22, 0x35, + 0x2a, 0x55, 0x79, 0x35, 0x59, 0xf0, 0x01, 0x80, 0x48, 0xd5, 0xff, 0xa9, 0x5d, 0x0f, 0xa3, 0xb3, + 0x94, 0x94, 0x3e, 0x83, 0x97, 0x63, 0x4e, 0x27, 0xc8, 0xe9, 0x23, 0x50, 0x39, 0xfc, 0xbb, 0xfe, + 0x89, 0x89, 0x49, 0xb5, 0x08, 0x79, 0x7e, 0x94, 0x2a, 0xa4, 0xd3, 0xe4, 0x01, 0x66, 0xcc, 0x79, + 0xbe, 0x71, 0xbf, 0xd3, 0x8c, 0x90, 0x9e, 0x8e, 0x92, 0xb6, 0x60, 0x71, 0x24, 0xea, 0x09, 0x12, + 0xff, 0x5c, 0xea, 0xe2, 0x77, 0x96, 0xec, 0xe9, 0x14, 0x47, 0x75, 0x73, 0x44, 0x77, 0x4d, 0xd2, + 0xdc, 0x3f, 0x28, 0x50, 0x88, 0x87, 0x97, 0xe9, 0xad, 0xc1, 0xa9, 0xe0, 0x64, 0xfa,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0x61, 0xfa, 0xb1, + 0x1f, 0x0f, 0x45, 0xf7, 0x7a, 0x2d, 0xcc, 0xec, 0x39, 0xfe, 0xd7, 0xc5, 0xf5, 0xbf, 0x03, 0x00, + 0x00, 0xff, 0xff, 0xa2, 0x65, 0x2d, 0x0a, 0xf1, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1053,6 +1149,8 @@ type QueryClient interface { ChainList(ctx context.Context, in *QueryChainListRequest, opts ...grpc.CallOption) (*QueryChainListResponse, error) // ChainInfo queries the latest info of a chain in Babylon's view ChainInfo(ctx context.Context, in *QueryChainInfoRequest, opts ...grpc.CallOption) (*QueryChainInfoResponse, error) + // ChainsInfo queries the latest info of given chains in Babylon's view + ChainsInfo(ctx context.Context, in *QueryChainsInfoRequest, opts ...grpc.CallOption) (*QueryChainsInfoResponse, error) // EpochChainInfo queries the latest info of a chain in a given epoch of // Babylon's view EpochChainInfo(ctx context.Context, in *QueryEpochChainInfoRequest, opts ...grpc.CallOption) (*QueryEpochChainInfoResponse, error) @@ -1104,6 +1202,15 @@ func (c *queryClient) ChainInfo(ctx context.Context, in *QueryChainInfoRequest, return out, nil } +func (c *queryClient) ChainsInfo(ctx context.Context, in *QueryChainsInfoRequest, opts ...grpc.CallOption) (*QueryChainsInfoResponse, error) { + out := new(QueryChainsInfoResponse) + err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/ChainsInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) EpochChainInfo(ctx context.Context, in *QueryEpochChainInfoRequest, opts ...grpc.CallOption) (*QueryEpochChainInfoResponse, error) { out := new(QueryEpochChainInfoResponse) err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/EpochChainInfo", in, out, opts...) @@ -1157,6 +1264,8 @@ type QueryServer interface { ChainList(context.Context, *QueryChainListRequest) (*QueryChainListResponse, error) // ChainInfo queries the latest info of a chain in Babylon's view ChainInfo(context.Context, *QueryChainInfoRequest) (*QueryChainInfoResponse, error) + // ChainsInfo queries the latest info of given chains in Babylon's view + ChainsInfo(context.Context, *QueryChainsInfoRequest) (*QueryChainsInfoResponse, error) // EpochChainInfo queries the latest info of a chain in a given epoch of // Babylon's view EpochChainInfo(context.Context, *QueryEpochChainInfoRequest) (*QueryEpochChainInfoResponse, error) @@ -1186,6 +1295,9 @@ func (*UnimplementedQueryServer) ChainList(ctx context.Context, req *QueryChainL func (*UnimplementedQueryServer) ChainInfo(ctx context.Context, req *QueryChainInfoRequest) (*QueryChainInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainInfo not implemented") } +func (*UnimplementedQueryServer) ChainsInfo(ctx context.Context, req *QueryChainsInfoRequest) (*QueryChainsInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChainsInfo not implemented") +} func (*UnimplementedQueryServer) EpochChainInfo(ctx context.Context, req *QueryEpochChainInfoRequest) (*QueryEpochChainInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EpochChainInfo not implemented") } @@ -1260,6 +1372,24 @@ func _Query_ChainInfo_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_ChainsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryChainsInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ChainsInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/babylon.zoneconcierge.v1.Query/ChainsInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ChainsInfo(ctx, req.(*QueryChainsInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_EpochChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryEpochChainInfoRequest) if err := dec(in); err != nil { @@ -1366,6 +1496,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ChainInfo", Handler: _Query_ChainInfo_Handler, }, + { + MethodName: "ChainsInfo", + Handler: _Query_ChainsInfo_Handler, + }, { MethodName: "EpochChainInfo", Handler: _Query_EpochChainInfo_Handler, @@ -1617,6 +1751,71 @@ func (m *QueryChainInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryChainsInfoRequest) 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 *QueryChainsInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChainsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryChainsInfoResponse) 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 *QueryChainsInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChainsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainInfo != nil { + { + size, err := m.ChainInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryEpochChainInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2203,6 +2402,32 @@ func (m *QueryChainInfoResponse) Size() (n int) { return n } +func (m *QueryChainsInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryChainsInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainInfo != nil { + l = m.ChainInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryEpochChainInfoRequest) Size() (n int) { if m == nil { return 0 @@ -2993,6 +3218,174 @@ func (m *QueryChainInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryChainsInfoRequest) 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: QueryChainsInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChainsInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", 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.ChainId = 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 *QueryChainsInfoResponse) 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: QueryChainsInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChainsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChainInfo == nil { + m.ChainInfo = &ChainInfo{} + } + if err := m.ChainInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *QueryEpochChainInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/zoneconcierge/types/query.pb.gw.go b/x/zoneconcierge/types/query.pb.gw.go index 8766d6fd7..9e2bc5956 100644 --- a/x/zoneconcierge/types/query.pb.gw.go +++ b/x/zoneconcierge/types/query.pb.gw.go @@ -199,6 +199,42 @@ func local_request_Query_ChainInfo_0(ctx context.Context, marshaler runtime.Mars } +var ( + filter_Query_ChainsInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ChainsInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChainsInfoRequest + 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_ChainsInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ChainsInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ChainsInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChainsInfoRequest + 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_ChainsInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ChainsInfo(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_EpochChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryEpochChainInfoRequest var metadata runtime.ServerMetadata @@ -664,6 +700,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ChainsInfo_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_ChainsInfo_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_ChainsInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_EpochChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -880,6 +939,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ChainsInfo_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_ChainsInfo_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_ChainsInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_EpochChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -990,6 +1069,8 @@ var ( pattern_Query_ChainInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"babylon", "zoneconcierge", "v1", "chain_info", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ChainsInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"babylon", "zoneconcierge", "v1", "chains_info"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EpochChainInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"babylon", "zoneconcierge", "v1", "chain_info", "chain_id", "epochs", "epoch_num"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ListHeaders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"babylon", "zoneconcierge", "v1", "headers", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1008,6 +1089,8 @@ var ( forward_Query_ChainInfo_0 = runtime.ForwardResponseMessage + forward_Query_ChainsInfo_0 = runtime.ForwardResponseMessage + forward_Query_EpochChainInfo_0 = runtime.ForwardResponseMessage forward_Query_ListHeaders_0 = runtime.ForwardResponseMessage From e3e99139954be1b084f68ccf8b7d9e27eeca764e Mon Sep 17 00:00:00 2001 From: Gurjot Date: Tue, 25 Apr 2023 15:28:00 +0530 Subject: [PATCH 02/21] accept repeated str --- proto/babylon/zoneconcierge/v1/query.proto | 5 +- x/zoneconcierge/keeper/grpc_query.go | 8 +- x/zoneconcierge/types/query.pb.go | 216 +++++++++++---------- 3 files changed, 117 insertions(+), 112 deletions(-) diff --git a/proto/babylon/zoneconcierge/v1/query.proto b/proto/babylon/zoneconcierge/v1/query.proto index 0b786044e..81e31c512 100644 --- a/proto/babylon/zoneconcierge/v1/query.proto +++ b/proto/babylon/zoneconcierge/v1/query.proto @@ -103,12 +103,11 @@ message QueryChainInfoResponse { } // QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. -message QueryChainsInfoRequest { string chain_id = 1; } +message QueryChainsInfoRequest { repeated string chain_ids = 1; } // QueryChainsInfoResponse is response type for the Query/ChainInfo RPC method. message QueryChainsInfoResponse { - // chain_info is the info of the CZ - babylon.zoneconcierge.v1.ChainInfo chain_info = 1; + repeated babylon.zoneconcierge.v1.ChainInfo chains_info = 1; } // QueryEpochChainInfoRequest is request type for the Query/EpochChainInfo RPC diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 8b8c112b1..1fc74195e 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -65,18 +65,18 @@ func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) return nil, status.Error(codes.InvalidArgument, "invalid request") } - if len(req.ChainId) == 0 { - return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") + if len(req.ChainIds) == 0 { + return nil, status.Error(codes.InvalidArgument, "chain IDs cannot be empty") } ctx := sdk.UnwrapSDKContext(c) // find the chain info of this epoch - chainInfo, err := k.GetChainInfo(ctx, req.ChainId) + chainInfo, err := k.GetChainInfo(ctx, req.ChainIds[0]) if err != nil { return nil, err } - resp := &types.QueryChainsInfoResponse{ChainInfo: chainInfo} + resp := &types.QueryChainsInfoResponse{ChainsInfo: []*types.ChainInfo{chainInfo}} return resp, nil } diff --git a/x/zoneconcierge/types/query.pb.go b/x/zoneconcierge/types/query.pb.go index faa152bce..c73525e4d 100644 --- a/x/zoneconcierge/types/query.pb.go +++ b/x/zoneconcierge/types/query.pb.go @@ -332,7 +332,7 @@ func (m *QueryChainInfoResponse) GetChainInfo() *ChainInfo { // QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. type QueryChainsInfoRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainIds []string `protobuf:"bytes,1,rep,name=chain_ids,json=chainIds,proto3" json:"chain_ids,omitempty"` } func (m *QueryChainsInfoRequest) Reset() { *m = QueryChainsInfoRequest{} } @@ -368,17 +368,16 @@ func (m *QueryChainsInfoRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryChainsInfoRequest proto.InternalMessageInfo -func (m *QueryChainsInfoRequest) GetChainId() string { +func (m *QueryChainsInfoRequest) GetChainIds() []string { if m != nil { - return m.ChainId + return m.ChainIds } - return "" + return nil } // QueryChainsInfoResponse is response type for the Query/ChainInfo RPC method. type QueryChainsInfoResponse struct { - // chain_info is the info of the CZ - ChainInfo *ChainInfo `protobuf:"bytes,1,opt,name=chain_info,json=chainInfo,proto3" json:"chain_info,omitempty"` + ChainsInfo []*ChainInfo `protobuf:"bytes,1,rep,name=chains_info,json=chainsInfo,proto3" json:"chains_info,omitempty"` } func (m *QueryChainsInfoResponse) Reset() { *m = QueryChainsInfoResponse{} } @@ -414,9 +413,9 @@ func (m *QueryChainsInfoResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryChainsInfoResponse proto.InternalMessageInfo -func (m *QueryChainsInfoResponse) GetChainInfo() *ChainInfo { +func (m *QueryChainsInfoResponse) GetChainsInfo() []*ChainInfo { if m != nil { - return m.ChainInfo + return m.ChainsInfo } return nil } @@ -1058,77 +1057,78 @@ func init() { } var fileDescriptor_cd665af90102da38 = []byte{ - // 1115 bytes of a gzipped FileDescriptorProto + // 1131 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xc6, 0x49, 0x1a, 0xbf, 0xd0, 0xaa, 0x1a, 0x4a, 0x31, 0x9b, 0xd6, 0x8d, 0x96, 0x3f, - 0x4d, 0xab, 0x74, 0x17, 0xbb, 0x2d, 0x25, 0xe2, 0x50, 0x25, 0x29, 0x49, 0x43, 0x51, 0x69, 0x16, - 0xc2, 0x01, 0x81, 0xac, 0xdd, 0xf5, 0xd8, 0x5e, 0x25, 0x9e, 0x71, 0x3d, 0x6b, 0xb7, 0x6e, 0x08, + 0x14, 0xcf, 0xc6, 0x49, 0x1a, 0x3f, 0xd3, 0xaa, 0x1a, 0x4a, 0x31, 0x9b, 0xd6, 0x8d, 0x96, 0x3f, + 0x4d, 0xab, 0x74, 0x17, 0x9b, 0x86, 0x12, 0x71, 0xa8, 0xf2, 0x87, 0xa4, 0xa1, 0xa8, 0x34, 0x0b, + 0xe1, 0x80, 0x90, 0xac, 0xdd, 0xf5, 0xd8, 0x5e, 0x25, 0x9e, 0x71, 0x3d, 0x6b, 0xb7, 0x6e, 0x08, 0x07, 0x3e, 0x01, 0x12, 0x17, 0xc4, 0x09, 0x09, 0x09, 0x24, 0x0e, 0xbd, 0xf2, 0x15, 0x40, 0xea, - 0xa1, 0x12, 0x17, 0x8e, 0x28, 0xe1, 0x6b, 0x20, 0xa1, 0x9d, 0x99, 0xb5, 0x77, 0xbd, 0x5e, 0xbc, - 0x6b, 0x72, 0xe0, 0xc0, 0xcd, 0x33, 0xfb, 0xde, 0xef, 0xfd, 0xde, 0xef, 0xbd, 0x99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be, 0x39, 0x29, 0x4c, 0x3d, 0x3b, 0x29, 0x4c, 0xfd, 0x79, 0x52, 0x98, + 0xfa, 0x7c, 0xa5, 0xe6, 0x7a, 0xf5, 0xb6, 0xad, 0x3b, 0xb4, 0x11, 0x84, 0xe3, 0x30, 0xbd, 0xd8, + 0x8f, 0x06, 0xa2, 0x7b, 0xdd, 0x26, 0x66, 0xf6, 0x1c, 0xff, 0xfb, 0xe2, 0x9d, 0x7f, 0x03, 0x00, + 0x00, 0xff, 0xff, 0xb0, 0x44, 0x88, 0xb1, 0xf5, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1771,12 +1771,14 @@ func (m *QueryChainsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa + if len(m.ChainIds) > 0 { + for iNdEx := len(m.ChainIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ChainIds[iNdEx]) + copy(dAtA[i:], m.ChainIds[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainIds[iNdEx]))) + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } @@ -1801,17 +1803,19 @@ func (m *QueryChainsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if m.ChainInfo != nil { - { - size, err := m.ChainInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ChainsInfo) > 0 { + for iNdEx := len(m.ChainsInfo) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ChainsInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -2408,9 +2412,11 @@ func (m *QueryChainsInfoRequest) Size() (n int) { } var l int _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.ChainIds) > 0 { + for _, s := range m.ChainIds { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } } return n } @@ -2421,9 +2427,11 @@ func (m *QueryChainsInfoResponse) Size() (n int) { } var l int _ = l - if m.ChainInfo != nil { - l = m.ChainInfo.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.ChainsInfo) > 0 { + for _, e := range m.ChainsInfo { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } } return n } @@ -3249,7 +3257,7 @@ func (m *QueryChainsInfoRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainIds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3277,7 +3285,7 @@ func (m *QueryChainsInfoRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ChainIds = append(m.ChainIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -3331,7 +3339,7 @@ func (m *QueryChainsInfoResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainsInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3358,10 +3366,8 @@ func (m *QueryChainsInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ChainInfo == nil { - m.ChainInfo = &ChainInfo{} - } - if err := m.ChainInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ChainsInfo = append(m.ChainsInfo, &ChainInfo{}) + if err := m.ChainsInfo[len(m.ChainsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From 0e563f217be7e325c79ea76dde53dc7a98bef103 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Tue, 25 Apr 2023 16:57:56 +0530 Subject: [PATCH 03/21] add query cmd --- x/zoneconcierge/client/cli/query.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index 0ecf92e7a..32aef8f77 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -1,9 +1,12 @@ package cli import ( + "context" "fmt" + // "strings" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -24,5 +27,30 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } + cmd.AddCommand(CmdChainsInfo()) + return cmd +} + +func CmdChainsInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "chains-info ", + Short: "retrieve the chain info of given chain ids", + Args: cobra.RangeArgs(1, 5), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + req := types.QueryChainsInfoRequest{ChainIds: args} + resp, err := queryClient.ChainsInfo(context.Background(), &req) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } + + flags.AddQueryFlagsToCmd(cmd) return cmd } From b076f459d94308647792b9375cc65974e464ac64 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Tue, 25 Apr 2023 17:01:36 +0530 Subject: [PATCH 04/21] logic --- x/zoneconcierge/keeper/grpc_query.go | 14 ++++-- x/zoneconcierge/keeper/grpc_query_test.go | 59 +++++++++++++++++++++-- 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 1fc74195e..605d81eae 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -70,13 +70,17 @@ func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) } ctx := sdk.UnwrapSDKContext(c) + var chainsInfo []*types.ChainInfo + for _, chainID := range req.ChainIds { + chainInfo, err := k.GetChainInfo(ctx, chainID) + if err != nil { + return nil, err + } - // find the chain info of this epoch - chainInfo, err := k.GetChainInfo(ctx, req.ChainIds[0]) - if err != nil { - return nil, err + chainsInfo = append(chainsInfo, chainInfo) } - resp := &types.QueryChainsInfoResponse{ChainsInfo: []*types.ChainInfo{chainInfo}} + + resp := &types.QueryChainsInfoResponse{ChainsInfo: chainsInfo} return resp, nil } diff --git a/x/zoneconcierge/keeper/grpc_query_test.go b/x/zoneconcierge/keeper/grpc_query_test.go index 5903cdfb3..794aa68c1 100644 --- a/x/zoneconcierge/keeper/grpc_query_test.go +++ b/x/zoneconcierge/keeper/grpc_query_test.go @@ -4,11 +4,6 @@ import ( "math/rand" "testing" - "github.com/babylonchain/babylon/testutil/datagen" - testkeeper "github.com/babylonchain/babylon/testutil/keeper" - btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types" - checkpointingtypes "github.com/babylonchain/babylon/x/checkpointing/types" - zctypes "github.com/babylonchain/babylon/x/zoneconcierge/types" tmcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" tmtypes "github.com/cometbft/cometbft/types" @@ -16,6 +11,12 @@ import ( ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + + "github.com/babylonchain/babylon/testutil/datagen" + testkeeper "github.com/babylonchain/babylon/testutil/keeper" + btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types" + checkpointingtypes "github.com/babylonchain/babylon/x/checkpointing/types" + zctypes "github.com/babylonchain/babylon/x/zoneconcierge/types" ) func FuzzChainList(f *testing.F) { @@ -91,6 +92,54 @@ func FuzzChainInfo(f *testing.F) { }) } +func FuzzChainsInfo(f *testing.F) { + datagen.AddRandomSeedsToFuzzer(f, 10) + + f.Fuzz(func(t *testing.T, seed int64) { + rand.Seed(seed) + + _, babylonChain, _, babylonApp := SetupTest(t) + zcKeeper := babylonApp.ZoneConciergeKeeper + + ctx := babylonChain.GetContext() + hooks := zcKeeper.Hooks() + + numChains := datagen.RandomInt(100) + 1 + var ( + chainsInfo []struct { + chainID string + numHeaders uint64 + numForkHeaders uint64 + } + chainIDs []string + ) + for i := uint64(0); i < numChains; i++ { + chainID := datagen.GenRandomHexStr(30) + chainIDs = append(chainIDs, chainID) + + numHeaders := datagen.RandomInt(100) + 1 + numForkHeaders := datagen.RandomInt(10) + 1 + SimulateHeadersAndForksViaHook(ctx, hooks, chainID, 0, numHeaders, numForkHeaders) + chainsInfo = append(chainsInfo, struct { + chainID string + numHeaders uint64 + numForkHeaders uint64 + }{chainID, numHeaders, numForkHeaders}) + } + + resp, err := zcKeeper.ChainsInfo(ctx, &zctypes.QueryChainsInfoRequest{ + ChainIds: chainIDs, + }) + require.NoError(t, err) + + for i, data := range resp.ChainsInfo { + require.Equal(t, chainsInfo[i].chainID, data.ChainId) + require.Equal(t, chainsInfo[i].numHeaders-1, data.LatestHeader.Height) + require.Equal(t, chainsInfo[i].numForkHeaders, uint64(len(data.LatestForks.Headers))) + } + }) +} + func FuzzHeader(f *testing.F) { datagen.AddRandomSeedsToFuzzer(f, 10) From 5b43df7a0b7a28c760367331f4f92f7cc1a26cf2 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Tue, 25 Apr 2023 17:05:18 +0530 Subject: [PATCH 05/21] swag file --- client/docs/swagger-ui/swagger.yaml | 1702 +++++++++++++++++---------- 1 file changed, 1071 insertions(+), 631 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 5d1af6845..e2a87db28 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -287,6 +287,13 @@ paths: has dishonest majority and is stalling checkpoints (w in research paper) + checkpoint_tag: + type: string + title: >- + 4byte tag in hex format, required to be present in the + OP_RETURN transaction + + related to babylon description: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -1088,46 +1095,6 @@ paths: type: boolean tags: - Query - /babylon/btclightclient/v1/params: - get: - summary: Parameters queries the parameters of the module. - operationId: BtcLightClientParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - tags: - - Query /babylon/btclightclient/v1/tip: get: summary: Tip return best header on canonical chain @@ -1327,10 +1294,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -1370,6 +1333,7 @@ paths: name "y.z". + JSON @@ -1583,10 +1547,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -1626,6 +1586,7 @@ paths: name "y.z". + JSON @@ -2029,10 +1990,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -2072,6 +2029,7 @@ paths: name "y.z". + JSON @@ -2490,10 +2448,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -2533,6 +2487,7 @@ paths: name "y.z". + JSON @@ -2774,10 +2729,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -2817,6 +2768,7 @@ paths: name "y.z". + JSON @@ -3116,10 +3068,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -3159,6 +3107,7 @@ paths: name "y.z". + JSON @@ -3435,10 +3384,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -3478,6 +3423,7 @@ paths: name "y.z". + JSON @@ -3793,10 +3739,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -3837,6 +3779,7 @@ paths: name "y.z". + JSON @@ -4142,10 +4085,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -4185,6 +4124,7 @@ paths: name "y.z". + JSON @@ -4430,10 +4370,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -4473,6 +4409,7 @@ paths: name "y.z". + JSON @@ -4682,10 +4619,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -4725,6 +4658,7 @@ paths: name "y.z". + JSON @@ -5118,46 +5052,6 @@ paths: - CKPT_STATUS_FINALIZED tags: - Query - /babylon/checkpointing/v1/params: - get: - summary: Parameters queries the parameters of the module. - operationId: CheckpointingParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - tags: - - Query /babylon/checkpointing/v1/raw_checkpoint/{epoch_num}: get: summary: RawCheckpoint queries a checkpoints at a given epoch number. @@ -5990,10 +5884,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -6033,6 +5923,7 @@ paths: name "y.z". + JSON @@ -6505,10 +6396,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -6548,6 +6435,7 @@ paths: name "y.z". + JSON @@ -6882,7 +6770,7 @@ paths: cannot be verified without knowing the validator set in the previous header. description: >- - QueryParamsResponse is response type for the Query/Header RPC + QueryHeaderResponse is response type for the Query/Header RPC method. default: description: An unexpected error response. @@ -6997,10 +6885,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -7040,6 +6924,7 @@ paths: name "y.z". + JSON @@ -7252,10 +7137,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -7295,6 +7176,7 @@ paths: name "y.z". + JSON @@ -7392,120 +7274,637 @@ paths: type: boolean tags: - Query - /babylon/zoneconcierge/v1/finalized_chain_info/{chain_id}: + /babylon/zoneconcierge/v1/chains_info: get: - summary: >- - FinalizedChainInfo queries the BTC-finalised info of a chain, with - proofs - operationId: FinalizedChainInfo + summary: ChainsInfo queries the latest info of given chains in Babylon's view + operationId: ChainsInfo responses: '200': description: A successful response. schema: type: object properties: - finalized_chain_info: - title: finalized_chain_info is the info of the CZ - type: object - properties: - chain_id: - type: string - title: chain_id is the ID of the chain - latest_header: - title: latest_header is the latest header in CZ's canonical chain - type: object - properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger + chains_info: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the ID of the chain + latest_header: + title: >- + latest_header is the latest header in CZ's canonical + chain + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger - (hash, height) jointly provides the position of the - header on CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that - includes this CZ + (hash, height) jointly provides the position of the + header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block + that includes this CZ - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, - including all blockchain data structures and the - rules of the application's + including all blockchain data structures and the + rules of the application's - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: >- + epoch is the epoch number of this header on Babylon + ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes + this header + + (babylon_block_height, babylon_tx_hash) jointly + provides the position of + + the header on Babylon ledger + latest_forks: + title: >- + latest_forks is the latest forks, formed as a series of + IndexedHeader (from + + low to high) + type: object + properties: + headers: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ + ledger + + (hash, height) jointly provides the position + of the header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon + block that includes this CZ + + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: >- + Header defines the structure of a block + header. + babylon_epoch: + type: string + format: uint64 + title: >- + epoch is the epoch number of this header on + Babylon ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that + includes this header + + (babylon_block_height, babylon_tx_hash) + jointly provides the position of + + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: >- + blocks is the list of non-canonical indexed headers + at the same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at the + same height. + + For example, assuming the following blockchain + + ``` + + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` + + Then the fork will be {[D1, D2]} where each item is in + struct `IndexedBlock`. + + + Note that each `IndexedHeader` in the fork should have a + valid quorum + + certificate. Such forks exist since Babylon considers + CZs might have + + dishonest majority. Also note that the IBC-Go + implementation will only + + consider the first header in a fork valid, since the + subsequent headers + + cannot be verified without knowing the validator set in + the previous header. + timestamped_headers_count: + type: string + format: uint64 + title: >- + timestamped_headers_count is the number of timestamped + headers in CZ's + + canonical chain + title: ChainInfo is the information of a CZ + description: >- + QueryChainsInfoResponse is response type for the Query/ChainInfo + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: chain_ids + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + tags: + - Query + /babylon/zoneconcierge/v1/finalized_chain_info/{chain_id}: + get: + summary: >- + FinalizedChainInfo queries the BTC-finalised info of a chain, with + proofs + operationId: FinalizedChainInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + finalized_chain_info: + type: object + properties: + chain_id: + type: string + title: chain_id is the ID of the chain + latest_header: + title: latest_header is the latest header in CZ's canonical chain + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger + + (hash, height) jointly provides the position of the + header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that + includes this CZ + + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and the + rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string format: byte title: consensus info proposer_address: @@ -7701,6 +8100,7 @@ paths: headers in CZ's canonical chain + title: ChainInfo is the information of a CZ epoch_info: title: epoch_info is the metadata of the last BTC-finalised epoch type: object @@ -8286,10 +8686,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -8329,6 +8725,7 @@ paths: name "y.z". + JSON @@ -8397,7 +8794,6 @@ paths: type: object properties: finalized_chain_info: - title: finalized_chain_info is the info of the CZ type: object properties: chain_id: @@ -8693,6 +9089,7 @@ paths: headers in CZ's canonical chain + title: ChainInfo is the information of a CZ epoch_info: title: epoch_info is the metadata of the last BTC-finalised epoch type: object @@ -9280,10 +9677,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -9323,6 +9716,7 @@ paths: name "y.z". + JSON @@ -9668,10 +10062,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -9711,6 +10101,7 @@ paths: name "y.z". + JSON @@ -9942,236 +10333,14 @@ paths: (babylon_block_height, babylon_tx_hash) jointly provides the position of - the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: headers is the list of headers - description: >- - QueryListEpochHeadersResponse is response type for the - Query/ListEpochHeaders - - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: chain_id - in: path - required: true - type: string - - name: epoch_num - in: path - required: true - type: string - format: uint64 - tags: - - Query - /babylon/zoneconcierge/v1/params: - get: - summary: Parameters queries the parameters of the module. - operationId: ZoneConciergeParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: headers is the list of headers description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. + QueryListEpochHeadersResponse is response type for the + Query/ListEpochHeaders + + RPC method. default: description: An unexpected error response. schema: @@ -10285,10 +10454,6 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -10328,6 +10493,7 @@ paths: name "y.z". + JSON @@ -10366,6 +10532,16 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + parameters: + - name: chain_id + in: path + required: true + type: string + - name: epoch_num + in: path + required: true + type: string + format: uint64 tags: - Query definitions: @@ -10534,6 +10710,13 @@ definitions: has dishonest majority and is stalling checkpoints (w in research paper) + checkpoint_tag: + type: string + title: >- + 4byte tag in hex format, required to be present in the OP_RETURN + transaction + + related to babylon description: Params defines the parameters for the module. babylon.btccheckpoint.v1.QueryBtcCheckpointInfoResponse: type: object @@ -10910,6 +11093,13 @@ definitions: has dishonest majority and is stalling checkpoints (w in research paper) + checkpoint_tag: + type: string + title: >- + 4byte tag in hex format, required to be present in the OP_RETURN + transaction + + related to babylon description: QueryParamsResponse is response type for the Query/Params RPC method. babylon.btccheckpoint.v1.SubmissionKey: type: object @@ -11170,10 +11360,6 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -11209,6 +11395,7 @@ definitions: name "y.z". + JSON @@ -11349,10 +11536,6 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -11388,6 +11571,7 @@ definitions: name "y.z". + JSON @@ -11447,9 +11631,6 @@ definitions: - Total work spent on the header. This is the sum of the work corresponding to the header Bits field and the total work of the header. - babylon.btclightclient.v1.Params: - type: object - description: Params defines the parameters for the module. babylon.btclightclient.v1.QueryBaseHeaderResponse: type: object properties: @@ -11593,13 +11774,6 @@ definitions: description: >- QueryMainChainResponse is response type for the Query/MainChain RPC method. - babylon.btclightclient.v1.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - description: QueryParamsResponse is response type for the Query/Params RPC method. babylon.btclightclient.v1.QueryTipResponse: type: object properties: @@ -12360,10 +12534,6 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -12403,6 +12573,7 @@ definitions: name "y.z". + JSON @@ -13049,10 +13220,6 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -13092,6 +13259,7 @@ definitions: name "y.z". + JSON @@ -13509,10 +13677,6 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -13549,6 +13713,7 @@ definitions: name "y.z". + JSON @@ -13870,10 +14035,6 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -13913,6 +14074,7 @@ definitions: name "y.z". + JSON @@ -14359,10 +14521,6 @@ definitions: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } - // or ... - if (any.isSameTypeAs(Foo.getDefaultInstance())) { - foo = any.unpack(Foo.getDefaultInstance()); - } Example 3: Pack and unpack a message in Python. @@ -14398,6 +14556,7 @@ definitions: name "y.z". + JSON @@ -14664,9 +14823,6 @@ definitions: - CKPT_STATUS_SUBMITTED: SUBMITTED defines a checkpoint that is included on BTC. - CKPT_STATUS_CONFIRMED: CONFIRMED defines a checkpoint that is k-deep on BTC. - CKPT_STATUS_FINALIZED: FINALIZED defines a checkpoint that is w-deep on BTC. - babylon.checkpointing.v1.Params: - type: object - description: Params defines the parameters for the module. babylon.checkpointing.v1.QueryBlsPublicKeyListResponse: type: object properties: @@ -14769,13 +14925,6 @@ definitions: description: |- QueryLastCheckpointWithStatusResponse is the response type for the Query/LastCheckpointWithStatus RPC method. - babylon.checkpointing.v1.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - description: QueryParamsResponse is response type for the Query/Params RPC method. babylon.checkpointing.v1.QueryRawCheckpointListResponse: type: object properties: @@ -15749,9 +15898,6 @@ definitions: the header on Babylon ledger title: IndexedHeader is the metadata of a CZ header - babylon.zoneconcierge.v1.Params: - type: object - description: Params defines the parameters for the module. babylon.zoneconcierge.v1.ProofEpochSealed: type: object properties: @@ -16304,103 +16450,404 @@ definitions: description: Header defines the structure of a block header. babylon_epoch: type: string - format: uint64 - title: >- - epoch is the epoch number of this header on Babylon - ledger - babylon_tx_hash: + format: uint64 + title: >- + epoch is the epoch number of this header on Babylon + ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes this + header + + (babylon_block_height, babylon_tx_hash) jointly provides + the position of + + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: >- + blocks is the list of non-canonical indexed headers at the + same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at the same + height. + + For example, assuming the following blockchain + + ``` + + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` + + Then the fork will be {[D1, D2]} where each item is in struct + `IndexedBlock`. + + + Note that each `IndexedHeader` in the fork should have a valid + quorum + + certificate. Such forks exist since Babylon considers CZs might + have + + dishonest majority. Also note that the IBC-Go implementation will + only + + consider the first header in a fork valid, since the subsequent + headers + + cannot be verified without knowing the validator set in the + previous header. + timestamped_headers_count: + type: string + format: uint64 + title: >- + timestamped_headers_count is the number of timestamped headers in + CZ's + + canonical chain + description: >- + QueryChainInfoResponse is response type for the Query/ChainInfo RPC + method. + babylon.zoneconcierge.v1.QueryChainListResponse: + type: object + properties: + chain_ids: + type: array + items: + type: string + title: chain_ids are IDs of the chains in ascending alphabetical order + pagination: + title: pagination defines the pagination in the response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: QueryChainListResponse is response type for the Query/ChainList RPC method + babylon.zoneconcierge.v1.QueryChainsInfoResponse: + type: object + properties: + chains_info: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the ID of the chain + latest_header: + title: latest_header is the latest header in CZ's canonical chain + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger + + (hash, height) jointly provides the position of the header + on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that + includes this CZ + + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: type: string format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes this - header + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: epoch is the epoch number of this header on Babylon ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes this + header - (babylon_block_height, babylon_tx_hash) jointly provides - the position of + (babylon_block_height, babylon_tx_hash) jointly provides the + position of - the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: >- - blocks is the list of non-canonical indexed headers at the - same height - description: >- - Forks is a list of non-canonical `IndexedHeader`s at the same - height. + the header on Babylon ledger + latest_forks: + title: >- + latest_forks is the latest forks, formed as a series of + IndexedHeader (from - For example, assuming the following blockchain + low to high) + type: object + properties: + headers: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger - ``` + (hash, height) jointly provides the position of the + header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that + includes this CZ - A <- B <- C <- D <- E - \ -- D1 - \ -- D2 - ``` + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, - Then the fork will be {[D1, D2]} where each item is in struct - `IndexedBlock`. + including all blockchain data structures and the + rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: >- + epoch is the epoch number of this header on Babylon + ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes + this header + (babylon_block_height, babylon_tx_hash) jointly + provides the position of - Note that each `IndexedHeader` in the fork should have a valid - quorum + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: >- + blocks is the list of non-canonical indexed headers at the + same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at the same + height. - certificate. Such forks exist since Babylon considers CZs might - have + For example, assuming the following blockchain - dishonest majority. Also note that the IBC-Go implementation will - only + ``` - consider the first header in a fork valid, since the subsequent - headers + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` - cannot be verified without knowing the validator set in the - previous header. - timestamped_headers_count: - type: string - format: uint64 - title: >- - timestamped_headers_count is the number of timestamped headers in - CZ's + Then the fork will be {[D1, D2]} where each item is in struct + `IndexedBlock`. - canonical chain - description: >- - QueryChainInfoResponse is response type for the Query/ChainInfo RPC - method. - babylon.zoneconcierge.v1.QueryChainListResponse: - type: object - properties: - chain_ids: - type: array - items: - type: string - title: chain_ids are IDs of the chains in ascending alphabetical order - pagination: - title: pagination defines the pagination in the response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + Note that each `IndexedHeader` in the fork should have a valid + quorum - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: QueryChainListResponse is response type for the Query/ChainList RPC method + certificate. Such forks exist since Babylon considers CZs might + have + + dishonest majority. Also note that the IBC-Go implementation + will only + + consider the first header in a fork valid, since the subsequent + headers + + cannot be verified without knowing the validator set in the + previous header. + timestamped_headers_count: + type: string + format: uint64 + title: >- + timestamped_headers_count is the number of timestamped headers + in CZ's + + canonical chain + title: ChainInfo is the information of a CZ + description: >- + QueryChainsInfoResponse is response type for the Query/ChainInfo RPC + method. babylon.zoneconcierge.v1.QueryEpochChainInfoResponse: type: object properties: @@ -16706,7 +17153,6 @@ definitions: type: object properties: finalized_chain_info: - title: finalized_chain_info is the info of the CZ type: object properties: chain_id: @@ -16998,6 +17444,7 @@ definitions: CZ's canonical chain + title: ChainInfo is the information of a CZ epoch_info: title: epoch_info is the metadata of the last BTC-finalised epoch type: object @@ -17467,7 +17914,6 @@ definitions: type: object properties: finalized_chain_info: - title: finalized_chain_info is the info of the CZ type: object properties: chain_id: @@ -17759,6 +18205,7 @@ definitions: CZ's canonical chain + title: ChainInfo is the information of a CZ epoch_info: title: epoch_info is the metadata of the last BTC-finalised epoch type: object @@ -18493,7 +18940,7 @@ definitions: cannot be verified without knowing the validator set in the previous header. - description: QueryParamsResponse is response type for the Query/Header RPC method. + description: QueryHeaderResponse is response type for the Query/Header RPC method. babylon.zoneconcierge.v1.QueryListEpochHeadersResponse: type: object properties: @@ -18771,13 +19218,6 @@ definitions: description: |- QueryListHeadersResponse is response type for the Query/ListHeaders RPC method. - babylon.zoneconcierge.v1.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - description: QueryParamsResponse is response type for the Query/Params RPC method. tendermint.crypto.Proof: type: object properties: From f5121d47ab7fe61e0e0058ac0685c46614b04a8d Mon Sep 17 00:00:00 2001 From: Gurjot Date: Wed, 26 Apr 2023 13:19:52 +0530 Subject: [PATCH 06/21] add cli query for /babylon/zoneconcierge/v1/chain_info/{chain_id} --- x/zoneconcierge/client/cli/query.go | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index 32aef8f77..ce1c0bcd8 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -27,10 +27,33 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } + cmd.AddCommand(CmdChainInfo()) cmd.AddCommand(CmdChainsInfo()) return cmd } +func CmdChainInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "chain-info ", + Short: "retrieve the chain info of given chain id", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + req := types.QueryChainInfoRequest{ChainId: args[0]} + resp, err := queryClient.ChainInfo(context.Background(), &req) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + func CmdChainsInfo() *cobra.Command { cmd := &cobra.Command{ Use: "chains-info ", @@ -38,9 +61,7 @@ func CmdChainsInfo() *cobra.Command { Args: cobra.RangeArgs(1, 5), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) - queryClient := types.NewQueryClient(clientCtx) - req := types.QueryChainsInfoRequest{ChainIds: args} resp, err := queryClient.ChainsInfo(context.Background(), &req) if err != nil { From c058d251e58a8207a1bd968401e79e0f0a1c1539 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Wed, 26 Apr 2023 18:26:39 +0530 Subject: [PATCH 07/21] extend chain info api --- proto/babylon/zoneconcierge/v1/query.proto | 14 - x/zoneconcierge/client/cli/query.go | 23 - x/zoneconcierge/keeper/grpc_query.go | 21 - x/zoneconcierge/keeper/grpc_query_test.go | 69 +-- x/zoneconcierge/types/query.pb.go | 556 +++------------------ x/zoneconcierge/types/query.pb.gw.go | 101 ---- 6 files changed, 104 insertions(+), 680 deletions(-) diff --git a/proto/babylon/zoneconcierge/v1/query.proto b/proto/babylon/zoneconcierge/v1/query.proto index 81e31c512..ac2a3e3db 100644 --- a/proto/babylon/zoneconcierge/v1/query.proto +++ b/proto/babylon/zoneconcierge/v1/query.proto @@ -22,11 +22,6 @@ service Query { option (google.api.http).get = "/babylon/zoneconcierge/v1/chains"; } // ChainInfo queries the latest info of a chain in Babylon's view - rpc ChainInfo(QueryChainInfoRequest) returns (QueryChainInfoResponse) { - option (google.api.http).get = - "/babylon/zoneconcierge/v1/chain_info/{chain_id}"; - } - // ChainsInfo queries the latest info of given chains in Babylon's view rpc ChainsInfo(QueryChainsInfoRequest) returns (QueryChainsInfoResponse) { option (google.api.http).get = "/babylon/zoneconcierge/v1/chains_info"; @@ -93,15 +88,6 @@ message QueryChainListResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryChainInfoRequest is request type for the Query/ChainInfo RPC method. -message QueryChainInfoRequest { string chain_id = 1; } - -// QueryChainInfoResponse is response type for the Query/ChainInfo RPC method. -message QueryChainInfoResponse { - // chain_info is the info of the CZ - babylon.zoneconcierge.v1.ChainInfo chain_info = 1; -} - // QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. message QueryChainsInfoRequest { repeated string chain_ids = 1; } diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index ce1c0bcd8..5c9fdd1b8 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -27,33 +27,10 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdChainInfo()) cmd.AddCommand(CmdChainsInfo()) return cmd } -func CmdChainInfo() *cobra.Command { - cmd := &cobra.Command{ - Use: "chain-info ", - Short: "retrieve the chain info of given chain id", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - queryClient := types.NewQueryClient(clientCtx) - req := types.QueryChainInfoRequest{ChainId: args[0]} - resp, err := queryClient.ChainInfo(context.Background(), &req) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - func CmdChainsInfo() *cobra.Command { cmd := &cobra.Command{ Use: "chains-info ", diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 605d81eae..f02e47c87 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -38,27 +38,6 @@ func (k Keeper) ChainList(c context.Context, req *types.QueryChainListRequest) ( return resp, nil } -// ChainInfo returns the latest info of a chain with given ID -func (k Keeper) ChainInfo(c context.Context, req *types.QueryChainInfoRequest) (*types.QueryChainInfoResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - if len(req.ChainId) == 0 { - return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") - } - - ctx := sdk.UnwrapSDKContext(c) - - // find the chain info of this epoch - chainInfo, err := k.GetChainInfo(ctx, req.ChainId) - if err != nil { - return nil, err - } - resp := &types.QueryChainInfoResponse{ChainInfo: chainInfo} - return resp, nil -} - // ChainsInfo returns the latest info of chains with given IDs func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) (*types.QueryChainsInfoResponse, error) { if req == nil { diff --git a/x/zoneconcierge/keeper/grpc_query_test.go b/x/zoneconcierge/keeper/grpc_query_test.go index 794aa68c1..b657ae38b 100644 --- a/x/zoneconcierge/keeper/grpc_query_test.go +++ b/x/zoneconcierge/keeper/grpc_query_test.go @@ -66,37 +66,16 @@ func FuzzChainList(f *testing.F) { }) } -func FuzzChainInfo(f *testing.F) { - datagen.AddRandomSeedsToFuzzer(f, 10) - - f.Fuzz(func(t *testing.T, seed int64) { - r := rand.New(rand.NewSource(seed)) - - _, babylonChain, czChain, babylonApp := SetupTest(t) - zcKeeper := babylonApp.ZoneConciergeKeeper - - ctx := babylonChain.GetContext() - hooks := zcKeeper.Hooks() - - // invoke the hook a random number of times to simulate a random number of blocks - numHeaders := datagen.RandomInt(r, 100) + 1 - numForkHeaders := datagen.RandomInt(r, 10) + 1 - SimulateHeadersAndForksViaHook(ctx, r, hooks, czChain.ChainID, 0, numHeaders, numForkHeaders) - - // check if the chain info of is recorded or not - resp, err := zcKeeper.ChainInfo(ctx, &zctypes.QueryChainInfoRequest{ChainId: czChain.ChainID}) - require.NoError(t, err) - chainInfo := resp.ChainInfo - require.Equal(t, numHeaders-1, chainInfo.LatestHeader.Height) - require.Equal(t, numForkHeaders, uint64(len(chainInfo.LatestForks.Headers))) - }) -} - func FuzzChainsInfo(f *testing.F) { datagen.AddRandomSeedsToFuzzer(f, 10) + type chainInfo struct { + chainID string + numHeaders uint64 + numForkHeaders uint64 + } f.Fuzz(func(t *testing.T, seed int64) { - rand.Seed(seed) + r := rand.New(rand.NewSource(seed)) _, babylonChain, _, babylonApp := SetupTest(t) zcKeeper := babylonApp.ZoneConciergeKeeper @@ -104,29 +83,25 @@ func FuzzChainsInfo(f *testing.F) { ctx := babylonChain.GetContext() hooks := zcKeeper.Hooks() - numChains := datagen.RandomInt(100) + 1 - var ( - chainsInfo []struct { - chainID string - numHeaders uint64 - numForkHeaders uint64 - } - chainIDs []string - ) + var chainsInfo []chainInfo + numChains := datagen.RandomInt(r, 100) + 1 for i := uint64(0); i < numChains; i++ { - chainID := datagen.GenRandomHexStr(30) - chainIDs = append(chainIDs, chainID) - - numHeaders := datagen.RandomInt(100) + 1 - numForkHeaders := datagen.RandomInt(10) + 1 - SimulateHeadersAndForksViaHook(ctx, hooks, chainID, 0, numHeaders, numForkHeaders) - chainsInfo = append(chainsInfo, struct { - chainID string - numHeaders uint64 - numForkHeaders uint64 - }{chainID, numHeaders, numForkHeaders}) + chainID := datagen.GenRandomHexStr(r, 30) + numHeaders := datagen.RandomInt(r, 100) + 1 + numForkHeaders := datagen.RandomInt(r, 10) + 1 + SimulateHeadersAndForksViaHook(ctx, r, hooks, chainID, 0, numHeaders, numForkHeaders) + + chainsInfo = append(chainsInfo, chainInfo{ + chainID: chainID, + numHeaders: numHeaders, + numForkHeaders: numForkHeaders, + }) } + var chainIDs []string + for _, data := range chainsInfo { + chainIDs = append(chainIDs, data.chainID) + } resp, err := zcKeeper.ChainsInfo(ctx, &zctypes.QueryChainsInfoRequest{ ChainIds: chainIDs, }) diff --git a/x/zoneconcierge/types/query.pb.go b/x/zoneconcierge/types/query.pb.go index c73525e4d..66e42d8d3 100644 --- a/x/zoneconcierge/types/query.pb.go +++ b/x/zoneconcierge/types/query.pb.go @@ -239,97 +239,6 @@ func (m *QueryChainListResponse) GetPagination() *query.PageResponse { return nil } -// QueryChainInfoRequest is request type for the Query/ChainInfo RPC method. -type QueryChainInfoRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *QueryChainInfoRequest) Reset() { *m = QueryChainInfoRequest{} } -func (m *QueryChainInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryChainInfoRequest) ProtoMessage() {} -func (*QueryChainInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{4} -} -func (m *QueryChainInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChainInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChainInfoRequest.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 *QueryChainInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChainInfoRequest.Merge(m, src) -} -func (m *QueryChainInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryChainInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChainInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChainInfoRequest proto.InternalMessageInfo - -func (m *QueryChainInfoRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// QueryChainInfoResponse is response type for the Query/ChainInfo RPC method. -type QueryChainInfoResponse struct { - // chain_info is the info of the CZ - ChainInfo *ChainInfo `protobuf:"bytes,1,opt,name=chain_info,json=chainInfo,proto3" json:"chain_info,omitempty"` -} - -func (m *QueryChainInfoResponse) Reset() { *m = QueryChainInfoResponse{} } -func (m *QueryChainInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryChainInfoResponse) ProtoMessage() {} -func (*QueryChainInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{5} -} -func (m *QueryChainInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChainInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChainInfoResponse.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 *QueryChainInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChainInfoResponse.Merge(m, src) -} -func (m *QueryChainInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryChainInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChainInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChainInfoResponse proto.InternalMessageInfo - -func (m *QueryChainInfoResponse) GetChainInfo() *ChainInfo { - if m != nil { - return m.ChainInfo - } - return nil -} - // QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. type QueryChainsInfoRequest struct { ChainIds []string `protobuf:"bytes,1,rep,name=chain_ids,json=chainIds,proto3" json:"chain_ids,omitempty"` @@ -339,7 +248,7 @@ func (m *QueryChainsInfoRequest) Reset() { *m = QueryChainsInfoRequest{} func (m *QueryChainsInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryChainsInfoRequest) ProtoMessage() {} func (*QueryChainsInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{6} + return fileDescriptor_cd665af90102da38, []int{4} } func (m *QueryChainsInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -384,7 +293,7 @@ func (m *QueryChainsInfoResponse) Reset() { *m = QueryChainsInfoResponse func (m *QueryChainsInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryChainsInfoResponse) ProtoMessage() {} func (*QueryChainsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{7} + return fileDescriptor_cd665af90102da38, []int{5} } func (m *QueryChainsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -431,7 +340,7 @@ func (m *QueryEpochChainInfoRequest) Reset() { *m = QueryEpochChainInfoR func (m *QueryEpochChainInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryEpochChainInfoRequest) ProtoMessage() {} func (*QueryEpochChainInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{8} + return fileDescriptor_cd665af90102da38, []int{6} } func (m *QueryEpochChainInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -485,7 +394,7 @@ func (m *QueryEpochChainInfoResponse) Reset() { *m = QueryEpochChainInfo func (m *QueryEpochChainInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryEpochChainInfoResponse) ProtoMessage() {} func (*QueryEpochChainInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{9} + return fileDescriptor_cd665af90102da38, []int{7} } func (m *QueryEpochChainInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -532,7 +441,7 @@ func (m *QueryListHeadersRequest) Reset() { *m = QueryListHeadersRequest func (m *QueryListHeadersRequest) String() string { return proto.CompactTextString(m) } func (*QueryListHeadersRequest) ProtoMessage() {} func (*QueryListHeadersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{10} + return fileDescriptor_cd665af90102da38, []int{8} } func (m *QueryListHeadersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -588,7 +497,7 @@ func (m *QueryListHeadersResponse) Reset() { *m = QueryListHeadersRespon func (m *QueryListHeadersResponse) String() string { return proto.CompactTextString(m) } func (*QueryListHeadersResponse) ProtoMessage() {} func (*QueryListHeadersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{11} + return fileDescriptor_cd665af90102da38, []int{9} } func (m *QueryListHeadersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -642,7 +551,7 @@ func (m *QueryListEpochHeadersRequest) Reset() { *m = QueryListEpochHead func (m *QueryListEpochHeadersRequest) String() string { return proto.CompactTextString(m) } func (*QueryListEpochHeadersRequest) ProtoMessage() {} func (*QueryListEpochHeadersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{12} + return fileDescriptor_cd665af90102da38, []int{10} } func (m *QueryListEpochHeadersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,7 +605,7 @@ func (m *QueryListEpochHeadersResponse) Reset() { *m = QueryListEpochHea func (m *QueryListEpochHeadersResponse) String() string { return proto.CompactTextString(m) } func (*QueryListEpochHeadersResponse) ProtoMessage() {} func (*QueryListEpochHeadersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{13} + return fileDescriptor_cd665af90102da38, []int{11} } func (m *QueryListEpochHeadersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -745,7 +654,7 @@ func (m *QueryFinalizedChainInfoRequest) Reset() { *m = QueryFinalizedCh func (m *QueryFinalizedChainInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryFinalizedChainInfoRequest) ProtoMessage() {} func (*QueryFinalizedChainInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{14} + return fileDescriptor_cd665af90102da38, []int{12} } func (m *QueryFinalizedChainInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -808,7 +717,7 @@ func (m *QueryFinalizedChainInfoResponse) Reset() { *m = QueryFinalizedC func (m *QueryFinalizedChainInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryFinalizedChainInfoResponse) ProtoMessage() {} func (*QueryFinalizedChainInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{15} + return fileDescriptor_cd665af90102da38, []int{13} } func (m *QueryFinalizedChainInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -893,7 +802,7 @@ func (m *QueryFinalizedChainInfoUntilHeightRequest) String() string { } func (*QueryFinalizedChainInfoUntilHeightRequest) ProtoMessage() {} func (*QueryFinalizedChainInfoUntilHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{16} + return fileDescriptor_cd665af90102da38, []int{14} } func (m *QueryFinalizedChainInfoUntilHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -967,7 +876,7 @@ func (m *QueryFinalizedChainInfoUntilHeightResponse) String() string { } func (*QueryFinalizedChainInfoUntilHeightResponse) ProtoMessage() {} func (*QueryFinalizedChainInfoUntilHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cd665af90102da38, []int{17} + return fileDescriptor_cd665af90102da38, []int{15} } func (m *QueryFinalizedChainInfoUntilHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1036,8 +945,6 @@ func init() { proto.RegisterType((*QueryHeaderResponse)(nil), "babylon.zoneconcierge.v1.QueryHeaderResponse") proto.RegisterType((*QueryChainListRequest)(nil), "babylon.zoneconcierge.v1.QueryChainListRequest") proto.RegisterType((*QueryChainListResponse)(nil), "babylon.zoneconcierge.v1.QueryChainListResponse") - proto.RegisterType((*QueryChainInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryChainInfoRequest") - proto.RegisterType((*QueryChainInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryChainInfoResponse") proto.RegisterType((*QueryChainsInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryChainsInfoRequest") proto.RegisterType((*QueryChainsInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryChainsInfoResponse") proto.RegisterType((*QueryEpochChainInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryEpochChainInfoRequest") @@ -1057,78 +964,76 @@ func init() { } var fileDescriptor_cd665af90102da38 = []byte{ - // 1131 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00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11, 0x84, 0xe3, 0x30, 0xbd, 0xd8, - 0x8f, 0x06, 0xa2, 0x7b, 0xdd, 0x26, 0x66, 0xf6, 0x1c, 0xff, 0xfb, 0xe2, 0x9d, 0x7f, 0x03, 0x00, - 0x00, 0xff, 0xff, 0xb0, 0x44, 0x88, 0xb1, 0xf5, 0x11, 0x00, 0x00, + // 1094 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xc6, 0x49, 0x9a, 0x3c, 0x97, 0xaa, 0x1a, 0x4a, 0x31, 0xdb, 0xd6, 0x8d, 0x96, 0x1f, + 0x4d, 0xab, 0x74, 0x17, 0x9b, 0x06, 0x88, 0x38, 0x54, 0xf9, 0x41, 0xd2, 0x50, 0x54, 0x9a, 0x85, + 0x70, 0xe0, 0xb2, 0xda, 0x5d, 0x8f, 0xed, 0x55, 0xe2, 0x19, 0xd7, 0xb3, 0x76, 0xeb, 0x86, 0x70, + 0xe0, 0x8e, 0x84, 0xc4, 0x05, 0x71, 0x42, 0x42, 0xe2, 0xc0, 0xa1, 0x7f, 0x07, 0x48, 0x3d, 0x54, + 0xe2, 0xc2, 0x11, 0x25, 0xfc, 0x1b, 0x48, 0x68, 0x67, 0x66, 0xd7, 0x5e, 0xaf, 0x37, 0x5e, 0x9b, + 0x1c, 0x38, 0x70, 0xcb, 0x8e, 0xdf, 0xfb, 0xde, 0xf7, 0xde, 0xfb, 0x66, 0xde, 0x0b, 0xbc, 0xe1, + 0xd8, 0x4e, 0xf7, 0x80, 0x12, 0xe3, 0x29, 0x25, 0xd8, 0xa5, 0xc4, 0xf5, 0x70, 0xab, 0x86, 0x8d, + 0x4e, 0xc9, 0x78, 0xd4, 0xc6, 0xad, 0xae, 0xde, 0x6c, 0x51, 0x9f, 0xa2, 0x82, 0xb4, 0xd2, 0x63, + 0x56, 0x7a, 0xa7,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0xd7, 0xdb, 0x8e, 0xee, 0xd2, 0x46, 0x18, 0x8e, 0xc3, 0x44, 0xb1, 0x9f, 0x0c, 0x44, 0xf7, 0xbb, + 0x4d, 0xcc, 0x9c, 0x39, 0xfe, 0x2f, 0xf8, 0x3b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xd3, + 0x0e, 0x7d, 0xb9, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1148,8 +1053,6 @@ type QueryClient interface { // ChainList queries the list of chains that checkpoint to Babylon ChainList(ctx context.Context, in *QueryChainListRequest, opts ...grpc.CallOption) (*QueryChainListResponse, error) // ChainInfo queries the latest info of a chain in Babylon's view - ChainInfo(ctx context.Context, in *QueryChainInfoRequest, opts ...grpc.CallOption) (*QueryChainInfoResponse, error) - // ChainsInfo queries the latest info of given chains in Babylon's view ChainsInfo(ctx context.Context, in *QueryChainsInfoRequest, opts ...grpc.CallOption) (*QueryChainsInfoResponse, error) // EpochChainInfo queries the latest info of a chain in a given epoch of // Babylon's view @@ -1193,15 +1096,6 @@ func (c *queryClient) ChainList(ctx context.Context, in *QueryChainListRequest, return out, nil } -func (c *queryClient) ChainInfo(ctx context.Context, in *QueryChainInfoRequest, opts ...grpc.CallOption) (*QueryChainInfoResponse, error) { - out := new(QueryChainInfoResponse) - err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/ChainInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) ChainsInfo(ctx context.Context, in *QueryChainsInfoRequest, opts ...grpc.CallOption) (*QueryChainsInfoResponse, error) { out := new(QueryChainsInfoResponse) err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/ChainsInfo", in, out, opts...) @@ -1263,8 +1157,6 @@ type QueryServer interface { // ChainList queries the list of chains that checkpoint to Babylon ChainList(context.Context, *QueryChainListRequest) (*QueryChainListResponse, error) // ChainInfo queries the latest info of a chain in Babylon's view - ChainInfo(context.Context, *QueryChainInfoRequest) (*QueryChainInfoResponse, error) - // ChainsInfo queries the latest info of given chains in Babylon's view ChainsInfo(context.Context, *QueryChainsInfoRequest) (*QueryChainsInfoResponse, error) // EpochChainInfo queries the latest info of a chain in a given epoch of // Babylon's view @@ -1292,9 +1184,6 @@ func (*UnimplementedQueryServer) Header(ctx context.Context, req *QueryHeaderReq func (*UnimplementedQueryServer) ChainList(ctx context.Context, req *QueryChainListRequest) (*QueryChainListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainList not implemented") } -func (*UnimplementedQueryServer) ChainInfo(ctx context.Context, req *QueryChainInfoRequest) (*QueryChainInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChainInfo not implemented") -} func (*UnimplementedQueryServer) ChainsInfo(ctx context.Context, req *QueryChainsInfoRequest) (*QueryChainsInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainsInfo not implemented") } @@ -1354,24 +1243,6 @@ func _Query_ChainList_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Query_ChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryChainInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ChainInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/babylon.zoneconcierge.v1.Query/ChainInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ChainInfo(ctx, req.(*QueryChainInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_ChainsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryChainsInfoRequest) if err := dec(in); err != nil { @@ -1492,10 +1363,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ChainList", Handler: _Query_ChainList_Handler, }, - { - MethodName: "ChainInfo", - Handler: _Query_ChainInfo_Handler, - }, { MethodName: "ChainsInfo", Handler: _Query_ChainsInfo_Handler, @@ -1686,71 +1553,6 @@ func (m *QueryChainListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryChainInfoRequest) 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 *QueryChainInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChainInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryChainInfoResponse) 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 *QueryChainInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChainInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ChainInfo != nil { - { - size, err := m.ChainInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *QueryChainsInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2380,32 +2182,6 @@ func (m *QueryChainListResponse) Size() (n int) { return n } -func (m *QueryChainInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryChainInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChainInfo != nil { - l = m.ChainInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - func (m *QueryChainsInfoRequest) Size() (n int) { if m == nil { return 0 @@ -3058,174 +2834,6 @@ func (m *QueryChainListResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryChainInfoRequest) 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: QueryChainInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", 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.ChainId = 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 *QueryChainInfoResponse) 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: QueryChainInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ChainInfo == nil { - m.ChainInfo = &ChainInfo{} - } - if err := m.ChainInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *QueryChainsInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/zoneconcierge/types/query.pb.gw.go b/x/zoneconcierge/types/query.pb.gw.go index 9e2bc5956..5a9e81fcf 100644 --- a/x/zoneconcierge/types/query.pb.gw.go +++ b/x/zoneconcierge/types/query.pb.gw.go @@ -145,60 +145,6 @@ func local_request_Query_ChainList_0(ctx context.Context, marshaler runtime.Mars } -func request_Query_ChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChainInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["chain_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") - } - - protoReq.ChainId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) - } - - msg, err := client.ChainInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChainInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["chain_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") - } - - protoReq.ChainId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) - } - - msg, err := server.ChainInfo(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_ChainsInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -677,29 +623,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_ChainInfo_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_ChainInfo_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_ChainInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_ChainsInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -919,26 +842,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_ChainInfo_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_ChainInfo_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_ChainInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_ChainsInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1067,8 +970,6 @@ var ( pattern_Query_ChainList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"babylon", "zoneconcierge", "v1", "chains"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ChainInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"babylon", "zoneconcierge", "v1", "chain_info", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ChainsInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"babylon", "zoneconcierge", "v1", "chains_info"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_EpochChainInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"babylon", "zoneconcierge", "v1", "chain_info", "chain_id", "epochs", "epoch_num"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1087,8 +988,6 @@ var ( forward_Query_ChainList_0 = runtime.ForwardResponseMessage - forward_Query_ChainInfo_0 = runtime.ForwardResponseMessage - forward_Query_ChainsInfo_0 = runtime.ForwardResponseMessage forward_Query_EpochChainInfo_0 = runtime.ForwardResponseMessage From 08d18f143347142d09df9a6f8172d131027b89c8 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Wed, 26 Apr 2023 18:29:01 +0530 Subject: [PATCH 08/21] update swag --- client/docs/swagger-ui/swagger.yaml | 1713 +++++++-------------------- 1 file changed, 453 insertions(+), 1260 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index e2a87db28..aa2264367 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -5461,10 +5461,12 @@ paths: type: boolean tags: - Query - /babylon/zoneconcierge/v1/chain_info/{chain_id}: + /babylon/zoneconcierge/v1/chain_info/{chain_id}/epochs/{epoch_num}: get: - summary: ChainInfo queries the latest info of a chain in Babylon's view - operationId: ChainInfo + summary: |- + EpochChainInfo queries the latest info of a chain in a given epoch of + Babylon's view + operationId: EpochChainInfo responses: '200': description: A successful response. @@ -5769,8 +5771,10 @@ paths: canonical chain description: >- - QueryChainInfoResponse is response type for the Query/ChainInfo - RPC method. + QueryEpochChainInfoResponse is response type for the + Query/EpochChainInfo RPC + + method. default: description: An unexpected error response. schema: @@ -5967,321 +5971,298 @@ paths: in: path required: true type: string + - name: epoch_num + in: path + required: true + type: string + format: uint64 tags: - Query - /babylon/zoneconcierge/v1/chain_info/{chain_id}/epochs/{epoch_num}: + /babylon/zoneconcierge/v1/chain_info/{chain_id}/header/{height}: get: - summary: |- - EpochChainInfo queries the latest info of a chain in a given epoch of - Babylon's view - operationId: EpochChainInfo + summary: Header queries the CZ header and fork headers at a given height. + operationId: Header responses: '200': description: A successful response. schema: type: object properties: - chain_info: - title: chain_info is the info of the CZ + header: type: object properties: chain_id: type: string - title: chain_id is the ID of the chain - latest_header: - title: latest_header is the latest header in CZ's canonical chain + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger + + (hash, height) jointly provides the position of the header + on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that + includes this CZ + + header type: object properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. chain_id: type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header height: type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the - header on CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that - includes this CZ - - header + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info type: object properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and the - rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: + hash: type: string - format: date-time - last_block_id: - title: prev block info + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: + title: PartsetHeader + last_commit_hash: type: string - format: uint64 - title: >- - epoch is the epoch number of this header on Babylon - ledger - babylon_tx_hash: + format: byte + title: hashes of block data + data_hash: type: string format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes - this header - - (babylon_block_height, babylon_tx_hash) jointly - provides the position of - - the header on Babylon ledger - latest_forks: + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: epoch is the epoch number of this header on Babylon ledger + babylon_tx_hash: + type: string + format: byte title: >- - latest_forks is the latest forks, formed as a series of - IndexedHeader (from - - low to high) - type: object - properties: - headers: - type: array - items: - type: object - properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger + babylon_tx_hash is the hash of the tx that includes this + header - (hash, height) jointly provides the position of - the header on CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon - block that includes this CZ + (babylon_block_height, babylon_tx_hash) jointly provides + the position of - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + fork_headers: + type: object + properties: + headers: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger - including all blockchain data structures and - the rules of the application's + (hash, height) jointly provides the position of the + header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block + that includes this CZ - state transition machine. - chain_id: + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: type: string - height: + format: uint64 + app: type: string - format: int64 - time: + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and the + rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: type: string - format: date-time - last_block_id: - title: prev block info + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: + title: PartsetHeader + last_commit_hash: type: string - format: uint64 - title: >- - epoch is the epoch number of this header on - Babylon ledger - babylon_tx_hash: + format: byte + title: hashes of block data + data_hash: type: string format: byte - title: >- - babylon_tx_hash is the hash of the tx that - includes this header - - (babylon_block_height, babylon_tx_hash) jointly - provides the position of + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: >- + epoch is the epoch number of this header on Babylon + ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes + this header - the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: >- - blocks is the list of non-canonical indexed headers at - the same height - description: >- - Forks is a list of non-canonical `IndexedHeader`s at the - same height. + (babylon_block_height, babylon_tx_hash) jointly + provides the position of - For example, assuming the following blockchain + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: >- + blocks is the list of non-canonical indexed headers at the + same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at the same + height. - ``` + For example, assuming the following blockchain - A <- B <- C <- D <- E - \ -- D1 - \ -- D2 - ``` + ``` - Then the fork will be {[D1, D2]} where each item is in - struct `IndexedBlock`. + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` + Then the fork will be {[D1, D2]} where each item is in struct + `IndexedBlock`. - Note that each `IndexedHeader` in the fork should have a - valid quorum - certificate. Such forks exist since Babylon considers CZs - might have + Note that each `IndexedHeader` in the fork should have a valid + quorum - dishonest majority. Also note that the IBC-Go - implementation will only + certificate. Such forks exist since Babylon considers CZs + might have - consider the first header in a fork valid, since the - subsequent headers + dishonest majority. Also note that the IBC-Go implementation + will only - cannot be verified without knowing the validator set in - the previous header. - timestamped_headers_count: - type: string - format: uint64 - title: >- - timestamped_headers_count is the number of timestamped - headers in CZ's + consider the first header in a fork valid, since the + subsequent headers - canonical chain + cannot be verified without knowing the validator set in the + previous header. description: >- - QueryEpochChainInfoResponse is response type for the - Query/EpochChainInfo RPC - + QueryHeaderResponse is response type for the Query/Header RPC method. default: description: An unexpected error response. @@ -6479,506 +6460,17 @@ paths: in: path required: true type: string - - name: epoch_num + - name: height in: path required: true type: string format: uint64 tags: - Query - /babylon/zoneconcierge/v1/chain_info/{chain_id}/header/{height}: + /babylon/zoneconcierge/v1/chains: get: - summary: Header queries the CZ header and fork headers at a given height. - operationId: Header - responses: - '200': - description: A successful response. - schema: - type: object - properties: - header: - type: object - properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the header - on CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that - includes this CZ - - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: - type: string - format: uint64 - title: epoch is the epoch number of this header on Babylon ledger - babylon_tx_hash: - type: string - format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes this - header - - (babylon_block_height, babylon_tx_hash) jointly provides - the position of - - the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - fork_headers: - type: object - properties: - headers: - type: array - items: - type: object - properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the - header on CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block - that includes this CZ - - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and the - rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: - type: string - format: uint64 - title: >- - epoch is the epoch number of this header on Babylon - ledger - babylon_tx_hash: - type: string - format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes - this header - - (babylon_block_height, babylon_tx_hash) jointly - provides the position of - - the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: >- - blocks is the list of non-canonical indexed headers at the - same height - description: >- - Forks is a list of non-canonical `IndexedHeader`s at the same - height. - - For example, assuming the following blockchain - - ``` - - A <- B <- C <- D <- E - \ -- D1 - \ -- D2 - ``` - - Then the fork will be {[D1, D2]} where each item is in struct - `IndexedBlock`. - - - Note that each `IndexedHeader` in the fork should have a valid - quorum - - certificate. Such forks exist since Babylon considers CZs - might have - - dishonest majority. Also note that the IBC-Go implementation - will only - - consider the first header in a fork valid, since the - subsequent headers - - cannot be verified without knowing the validator set in the - previous header. - description: >- - QueryHeaderResponse is response type for the Query/Header RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: chain_id - in: path - required: true - type: string - - name: height - in: path - required: true - type: string - format: uint64 - tags: - - Query - /babylon/zoneconcierge/v1/chains: - get: - summary: ChainList queries the list of chains that checkpoint to Babylon - operationId: ChainList + summary: ChainList queries the list of chains that checkpoint to Babylon + operationId: ChainList responses: '200': description: A successful response. @@ -7276,7 +6768,7 @@ paths: - Query /babylon/zoneconcierge/v1/chains_info: get: - summary: ChainsInfo queries the latest info of given chains in Babylon's view + summary: ChainInfo queries the latest info of a chain in Babylon's view operationId: ChainsInfo responses: '200': @@ -15948,569 +15440,270 @@ definitions: type: string format: byte title: |- - ProofOp defines an operation used for calculating Merkle root - The data could be arbitrary format, providing nessecary data - for example neighbouring node hash - proof_epoch_val_set: - title: |- - proof_epoch_info is the Merkle proof that the epoch's validator set is - committed to `app_hash` of the sealer header - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - title: |- - ProofOp defines an operation used for calculating Merkle root - The data could be arbitrary format, providing nessecary data - for example neighbouring node hash - title: >- - ProofEpochSealed is the proof that an epoch is sealed by the sealer - header, - - i.e., the 2nd header of the next epoch With the access of metadata - - - Metadata of this epoch, which includes the sealer header - - - Raw checkpoint of this epoch - - The verifier can perform the following verification rules: - - - The raw checkpoint's `last_commit_hash` is same as in the sealer header - - - More than 1/3 (in voting power) validators in the validator set of this - - epoch have signed `last_commit_hash` of the sealer header - - - The epoch medatata is committed to the `app_hash` of the sealer header - - - The validator set is committed to the `app_hash` of the sealer header - babylon.zoneconcierge.v1.ProofFinalizedChainInfo: - type: object - properties: - proof_tx_in_block: - title: >- - proof_tx_in_block is the proof that tx that carries the header is - included - - in a certain Babylon block - type: object - properties: - root_hash: - type: string - format: byte - data: - type: string - format: byte - proof: - type: object - properties: - total: - type: string - format: int64 - index: - type: string - format: int64 - leaf_hash: - type: string - format: byte - aunts: - type: array - items: - type: string - format: byte - description: >- - TxProof represents a Merkle proof of the presence of a transaction in - the Merkle tree. - proof_header_in_epoch: - type: object - properties: - total: - type: string - format: int64 - index: - type: string - format: int64 - leaf_hash: - type: string - format: byte - aunts: - type: array - items: - type: string - format: byte - title: >- - proof_header_in_epoch is the proof that the Babylon header is in a - certain - - epoch - proof_epoch_sealed: - title: proof_epoch_sealed is the proof that the epoch is sealed - type: object - properties: - validator_set: - type: array - items: - type: object - properties: - validator_address: - type: string - bls_pub_key: - type: string - format: byte - voting_power: - type: string - format: uint64 - title: >- - ValidatorWithBlsKey couples validator address, voting power, and - its bls - - public key - title: >- - validator_set is the validator set of the sealed epoch - - This validator set has generated a BLS multisig on - `last_commit_hash` of - - the sealer header - proof_epoch_info: - title: >- - proof_epoch_info is the Merkle proof that the epoch's metadata is - committed - - to `app_hash` of the sealer header - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - title: >- - ProofOp defines an operation used for calculating Merkle - root - - The data could be arbitrary format, providing nessecary data - - for example neighbouring node hash - proof_epoch_val_set: - title: >- - proof_epoch_info is the Merkle proof that the epoch's validator - set is - - committed to `app_hash` of the sealer header - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - title: >- - ProofOp defines an operation used for calculating Merkle - root - - The data could be arbitrary format, providing nessecary data - - for example neighbouring node hash - proof_epoch_submitted: - type: array - items: - type: object - properties: - key: + ProofOp defines an operation used for calculating Merkle root + The data could be arbitrary format, providing nessecary data + for example neighbouring node hash + proof_epoch_val_set: + title: |- + proof_epoch_info is the Merkle proof that the epoch's validator set is + committed to `app_hash` of the sealer header + type: object + properties: + ops: + type: array + items: type: object properties: - index: - type: integer - format: int64 - hash: + type: + type: string + key: type: string format: byte - title: >- - Each provided OP_RETURN transaction can be idendtified by hash - of block in - - which transaction was included and transaction index in the - block - description: >- - key is the position (txIdx, blockHash) of this tx on BTC - blockchain - - Although it is already a part of SubmissionKey, we store it here - again - - to make TransactionInfo self-contained. + data: + type: string + format: byte + title: |- + ProofOp defines an operation used for calculating Merkle root + The data could be arbitrary format, providing nessecary data + for example neighbouring node hash + title: >- + ProofEpochSealed is the proof that an epoch is sealed by the sealer + header, - For example, storing the key allows TransactionInfo to not relay - on + i.e., the 2nd header of the next epoch With the access of metadata - the fact that TransactionInfo will be ordered in the same order - as + - Metadata of this epoch, which includes the sealer header - TransactionKeys in SubmissionKey. - transaction: - type: string - format: byte - title: transaction is the full transaction in bytes - proof: - type: string - format: byte - title: >- - proof is the Merkle proof that this tx is included in the - position in `key` + - Raw checkpoint of this epoch - TODO: maybe it could use here better format as we already - processed and + The verifier can perform the following verification rules: - valideated the proof? - title: >- - TransactionInfo is the info of a tx that contains Babylon - checkpoint, + - The raw checkpoint's `last_commit_hash` is same as in the sealer header - including + - More than 1/3 (in voting power) validators in the validator set of this - - the position of the tx on BTC blockchain + epoch have signed `last_commit_hash` of the sealer header - - the full tx content + - The epoch medatata is committed to the `app_hash` of the sealer header - - the Merkle proof that this tx is on the above position + - The validator set is committed to the `app_hash` of the sealer header + babylon.zoneconcierge.v1.ProofFinalizedChainInfo: + type: object + properties: + proof_tx_in_block: title: >- - proof_epoch_submitted is the proof that the epoch's checkpoint is + proof_tx_in_block is the proof that tx that carries the header is included - in BTC ledger It is the two TransactionInfo in the best (i.e., - earliest) - - checkpoint submission - title: |- - ProofFinalizedChainInfo is a set of proofs that attest a chain info is - BTC-finalised - babylon.zoneconcierge.v1.QueryChainInfoResponse: - type: object - properties: - chain_info: - title: chain_info is the info of the CZ + in a certain Babylon block type: object properties: - chain_id: + root_hash: type: string - title: chain_id is the ID of the chain - latest_header: - title: latest_header is the latest header in CZ's canonical chain + format: byte + data: + type: string + format: byte + proof: type: object properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: + total: type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the header on - CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that - includes this CZ - - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a - block in the blockchain, - - including all blockchain data structures and the rules of - the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: + format: int64 + index: type: string - format: uint64 - title: epoch is the epoch number of this header on Babylon ledger - babylon_tx_hash: + format: int64 + leaf_hash: type: string format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes this - header + aunts: + type: array + items: + type: string + format: byte + description: >- + TxProof represents a Merkle proof of the presence of a transaction in + the Merkle tree. + proof_header_in_epoch: + type: object + properties: + total: + type: string + format: int64 + index: + type: string + format: int64 + leaf_hash: + type: string + format: byte + aunts: + type: array + items: + type: string + format: byte + title: >- + proof_header_in_epoch is the proof that the Babylon header is in a + certain + + epoch + proof_epoch_sealed: + title: proof_epoch_sealed is the proof that the epoch is sealed + type: object + properties: + validator_set: + type: array + items: + type: object + properties: + validator_address: + type: string + bls_pub_key: + type: string + format: byte + voting_power: + type: string + format: uint64 + title: >- + ValidatorWithBlsKey couples validator address, voting power, and + its bls - (babylon_block_height, babylon_tx_hash) jointly provides the - position of + public key + title: >- + validator_set is the validator set of the sealed epoch - the header on Babylon ledger - latest_forks: + This validator set has generated a BLS multisig on + `last_commit_hash` of + + the sealer header + proof_epoch_info: title: >- - latest_forks is the latest forks, formed as a series of - IndexedHeader (from + proof_epoch_info is the Merkle proof that the epoch's metadata is + committed - low to high) + to `app_hash` of the sealer header type: object properties: - headers: + ops: type: array items: type: object properties: - chain_id: + type: type: string - title: chain_id is the unique ID of the chain - hash: + key: type: string format: byte - title: hash is the hash of this header - height: + data: type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the - header on CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that - includes this CZ + format: byte + title: >- + ProofOp defines an operation used for calculating Merkle + root - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, + The data could be arbitrary format, providing nessecary data - including all blockchain data structures and the - rules of the application's + for example neighbouring node hash + proof_epoch_val_set: + title: >- + proof_epoch_info is the Merkle proof that the epoch's validator + set is - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: + committed to `app_hash` of the sealer header + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: type: string - format: uint64 - title: >- - epoch is the epoch number of this header on Babylon - ledger - babylon_tx_hash: + key: type: string format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes this - header + data: + type: string + format: byte + title: >- + ProofOp defines an operation used for calculating Merkle + root - (babylon_block_height, babylon_tx_hash) jointly provides - the position of + The data could be arbitrary format, providing nessecary data - the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: >- - blocks is the list of non-canonical indexed headers at the - same height - description: >- - Forks is a list of non-canonical `IndexedHeader`s at the same - height. + for example neighbouring node hash + proof_epoch_submitted: + type: array + items: + type: object + properties: + key: + type: object + properties: + index: + type: integer + format: int64 + hash: + type: string + format: byte + title: >- + Each provided OP_RETURN transaction can be idendtified by hash + of block in - For example, assuming the following blockchain + which transaction was included and transaction index in the + block + description: >- + key is the position (txIdx, blockHash) of this tx on BTC + blockchain - ``` + Although it is already a part of SubmissionKey, we store it here + again - A <- B <- C <- D <- E - \ -- D1 - \ -- D2 - ``` + to make TransactionInfo self-contained. - Then the fork will be {[D1, D2]} where each item is in struct - `IndexedBlock`. + For example, storing the key allows TransactionInfo to not relay + on + the fact that TransactionInfo will be ordered in the same order + as - Note that each `IndexedHeader` in the fork should have a valid - quorum + TransactionKeys in SubmissionKey. + transaction: + type: string + format: byte + title: transaction is the full transaction in bytes + proof: + type: string + format: byte + title: >- + proof is the Merkle proof that this tx is included in the + position in `key` - certificate. Such forks exist since Babylon considers CZs might - have + TODO: maybe it could use here better format as we already + processed and - dishonest majority. Also note that the IBC-Go implementation will - only + valideated the proof? + title: >- + TransactionInfo is the info of a tx that contains Babylon + checkpoint, - consider the first header in a fork valid, since the subsequent - headers + including - cannot be verified without knowing the validator set in the - previous header. - timestamped_headers_count: - type: string - format: uint64 - title: >- - timestamped_headers_count is the number of timestamped headers in - CZ's + - the position of the tx on BTC blockchain - canonical chain - description: >- - QueryChainInfoResponse is response type for the Query/ChainInfo RPC - method. + - the full tx content + + - the Merkle proof that this tx is on the above position + title: >- + proof_epoch_submitted is the proof that the epoch's checkpoint is + included + + in BTC ledger It is the two TransactionInfo in the best (i.e., + earliest) + + checkpoint submission + title: |- + ProofFinalizedChainInfo is a set of proofs that attest a chain info is + BTC-finalised babylon.zoneconcierge.v1.QueryChainListResponse: type: object properties: From e1ee1102a31cd7a0ce2c57891a0b994d8c7a98db Mon Sep 17 00:00:00 2001 From: Gurjot Date: Wed, 26 Apr 2023 18:32:40 +0530 Subject: [PATCH 09/21] typo --- client/docs/swagger-ui/swagger.yaml | 4 ++-- proto/babylon/zoneconcierge/v1/query.proto | 4 ++-- x/zoneconcierge/client/cli/query.go | 4 ---- x/zoneconcierge/types/query.pb.go | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index aa2264367..7ded4d2d7 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -7081,7 +7081,7 @@ paths: canonical chain title: ChainInfo is the information of a CZ description: >- - QueryChainsInfoResponse is response type for the Query/ChainInfo + QueryChainsInfoResponse is response type for the Query/ChainsInfo RPC method. default: description: An unexpected error response. @@ -16039,7 +16039,7 @@ definitions: canonical chain title: ChainInfo is the information of a CZ description: >- - QueryChainsInfoResponse is response type for the Query/ChainInfo RPC + QueryChainsInfoResponse is response type for the Query/ChainsInfo RPC method. babylon.zoneconcierge.v1.QueryEpochChainInfoResponse: type: object diff --git a/proto/babylon/zoneconcierge/v1/query.proto b/proto/babylon/zoneconcierge/v1/query.proto index ac2a3e3db..0a33dea00 100644 --- a/proto/babylon/zoneconcierge/v1/query.proto +++ b/proto/babylon/zoneconcierge/v1/query.proto @@ -88,10 +88,10 @@ message QueryChainListResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. +// QueryChainsInfoRequest is request type for the Query/ChainsInfo RPC method. message QueryChainsInfoRequest { repeated string chain_ids = 1; } -// QueryChainsInfoResponse is response type for the Query/ChainInfo RPC method. +// QueryChainsInfoResponse is response type for the Query/ChainsInfo RPC method. message QueryChainsInfoResponse { repeated babylon.zoneconcierge.v1.ChainInfo chains_info = 1; } diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index 5c9fdd1b8..6744cd407 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -4,14 +4,10 @@ import ( "context" "fmt" - // "strings" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" "github.com/babylonchain/babylon/x/zoneconcierge/types" ) diff --git a/x/zoneconcierge/types/query.pb.go b/x/zoneconcierge/types/query.pb.go index 66e42d8d3..88988b821 100644 --- a/x/zoneconcierge/types/query.pb.go +++ b/x/zoneconcierge/types/query.pb.go @@ -239,7 +239,7 @@ func (m *QueryChainListResponse) GetPagination() *query.PageResponse { return nil } -// QueryChainsInfoRequest is request type for the Query/ChainInfo RPC method. +// QueryChainsInfoRequest is request type for the Query/ChainsInfo RPC method. type QueryChainsInfoRequest struct { ChainIds []string `protobuf:"bytes,1,rep,name=chain_ids,json=chainIds,proto3" json:"chain_ids,omitempty"` } @@ -284,7 +284,7 @@ func (m *QueryChainsInfoRequest) GetChainIds() []string { return nil } -// QueryChainsInfoResponse is response type for the Query/ChainInfo RPC method. +// QueryChainsInfoResponse is response type for the Query/ChainsInfo RPC method. type QueryChainsInfoResponse struct { ChainsInfo []*ChainInfo `protobuf:"bytes,1,rep,name=chains_info,json=chainsInfo,proto3" json:"chains_info,omitempty"` } From 2be6a462d797b9bf7c0634f0cbfe61820b4e5bbe Mon Sep 17 00:00:00 2001 From: Gurjot Date: Wed, 26 Apr 2023 19:02:09 +0530 Subject: [PATCH 10/21] remove from e2e dir --- test/e2e/configurer/chain/queries.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/e2e/configurer/chain/queries.go b/test/e2e/configurer/chain/queries.go index 438df18aa..f3e44d8d4 100644 --- a/test/e2e/configurer/chain/queries.go +++ b/test/e2e/configurer/chain/queries.go @@ -209,17 +209,6 @@ func (n *NodeConfig) QueryCheckpointChains() (*[]string, error) { return &chainsResponse.ChainIds, nil } -func (n *NodeConfig) QueryCheckpointChainInfo(chainId string) (*zctypes.ChainInfo, error) { - infoPath := fmt.Sprintf("/babylon/zoneconcierge/v1/chain_info/%s", chainId) - bz, err := n.QueryGRPCGateway(infoPath) - require.NoError(n.t, err) - var infoResponse zctypes.QueryChainInfoResponse - if err := util.Cdc.UnmarshalJSON(bz, &infoResponse); err != nil { - return nil, err - } - return infoResponse.ChainInfo, nil -} - func (n *NodeConfig) QueryCurrentEpoch() (uint64, error) { bz, err := n.QueryGRPCGateway("/babylon/epoching/v1/current_epoch") require.NoError(n.t, err) From f9cf919604aac52bd93485e503649440a752cca6 Mon Sep 17 00:00:00 2001 From: Gurjot Singh <111540954+gusin13@users.noreply.github.com> Date: Thu, 27 Apr 2023 00:46:12 +0530 Subject: [PATCH 11/21] update docstring Co-authored-by: Vitalis Salis --- x/zoneconcierge/keeper/grpc_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index f02e47c87..1bbf54261 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -38,7 +38,7 @@ func (k Keeper) ChainList(c context.Context, req *types.QueryChainListRequest) ( return resp, nil } -// ChainsInfo returns the latest info of chains with given IDs +// ChainsInfo returns the latest info for a list of chains with given IDs func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) (*types.QueryChainsInfoResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") From fba823fd80cdf6d650c2ac3bd37ddacd7292a679 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 00:49:24 +0530 Subject: [PATCH 12/21] check if chain id empty --- x/zoneconcierge/keeper/grpc_query.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 1bbf54261..58a0e545b 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -51,6 +51,10 @@ func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) ctx := sdk.UnwrapSDKContext(c) var chainsInfo []*types.ChainInfo for _, chainID := range req.ChainIds { + if len(chainID) == 0 { + return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") + } + chainInfo, err := k.GetChainInfo(ctx, chainID) if err != nil { return nil, err From 6af0216756bafa6c6af3a304330c31cbffa465a2 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 00:52:25 +0530 Subject: [PATCH 13/21] make chain id slice in loop --- x/zoneconcierge/keeper/grpc_query_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x/zoneconcierge/keeper/grpc_query_test.go b/x/zoneconcierge/keeper/grpc_query_test.go index b657ae38b..31483706f 100644 --- a/x/zoneconcierge/keeper/grpc_query_test.go +++ b/x/zoneconcierge/keeper/grpc_query_test.go @@ -83,7 +83,10 @@ func FuzzChainsInfo(f *testing.F) { ctx := babylonChain.GetContext() hooks := zcKeeper.Hooks() - var chainsInfo []chainInfo + var ( + chainsInfo []chainInfo + chainIDs []string + ) numChains := datagen.RandomInt(r, 100) + 1 for i := uint64(0); i < numChains; i++ { chainID := datagen.GenRandomHexStr(r, 30) @@ -91,6 +94,7 @@ func FuzzChainsInfo(f *testing.F) { numForkHeaders := datagen.RandomInt(r, 10) + 1 SimulateHeadersAndForksViaHook(ctx, r, hooks, chainID, 0, numHeaders, numForkHeaders) + chainIDs = append(chainIDs, chainID) chainsInfo = append(chainsInfo, chainInfo{ chainID: chainID, numHeaders: numHeaders, @@ -98,10 +102,6 @@ func FuzzChainsInfo(f *testing.F) { }) } - var chainIDs []string - for _, data := range chainsInfo { - chainIDs = append(chainIDs, data.chainID) - } resp, err := zcKeeper.ChainsInfo(ctx, &zctypes.QueryChainsInfoRequest{ ChainIds: chainIDs, }) From 7fcfa35d756c8cbe96ecaa1441c0ccb6d44e391f Mon Sep 17 00:00:00 2001 From: Gurjot Singh <111540954+gusin13@users.noreply.github.com> Date: Thu, 27 Apr 2023 10:54:46 +0530 Subject: [PATCH 14/21] ctx suggestion Co-authored-by: Runchao Han --- x/zoneconcierge/client/cli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index 6744cd407..bcb97ea31 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -36,7 +36,7 @@ func CmdChainsInfo() *cobra.Command { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) req := types.QueryChainsInfoRequest{ChainIds: args} - resp, err := queryClient.ChainsInfo(context.Background(), &req) + resp, err := queryClient.ChainsInfo(cmd.Context(), &req) if err != nil { return err } From 70dead93e11e26adad7007ee6db0bcf616dd36fd Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 10:59:34 +0530 Subject: [PATCH 15/21] don't perform any query if chain empty --- x/zoneconcierge/client/cli/query.go | 1 - x/zoneconcierge/keeper/grpc_query.go | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index bcb97ea31..ef61b6634 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "github.com/cosmos/cosmos-sdk/client/flags" diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 58a0e545b..6192c0b36 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -48,13 +48,15 @@ func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) return nil, status.Error(codes.InvalidArgument, "chain IDs cannot be empty") } - ctx := sdk.UnwrapSDKContext(c) - var chainsInfo []*types.ChainInfo for _, chainID := range req.ChainIds { if len(chainID) == 0 { return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") } + } + ctx := sdk.UnwrapSDKContext(c) + var chainsInfo []*types.ChainInfo + for _, chainID := range req.ChainIds { chainInfo, err := k.GetChainInfo(ctx, chainID) if err != nil { return nil, err From 65f945b8c69b2104679f3eff76dbaf713078287a Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 11:36:38 +0530 Subject: [PATCH 16/21] arb args --- x/zoneconcierge/client/cli/query.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index ef61b6634..98d9e74ca 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -29,8 +29,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { func CmdChainsInfo() *cobra.Command { cmd := &cobra.Command{ Use: "chains-info ", - Short: "retrieve the chain info of given chain ids", - Args: cobra.RangeArgs(1, 5), + Short: "retrieves the latest info for a list of chains with given IDs", + Args: cobra.ArbitraryArgs, RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) From 8da5b991b072d83eff176f3f21e054defc92d834 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 11:52:12 +0530 Subject: [PATCH 17/21] add check for max query and dups --- x/zoneconcierge/keeper/grpc_query.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 6192c0b36..723a22dc6 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -13,6 +13,8 @@ import ( var _ types.QueryServer = Keeper{} +const maxQueryChainsInfoLimit = 100 + func (k Keeper) ChainList(c context.Context, req *types.QueryChainListRequest) (*types.QueryChainListResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") @@ -48,10 +50,22 @@ func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) return nil, status.Error(codes.InvalidArgument, "chain IDs cannot be empty") } + if len(req.ChainIds) > maxQueryChainsInfoLimit { + return nil, status.Errorf(codes.InvalidArgument, "cannot query more than %d chains", maxQueryChainsInfoLimit) + } + + encountered := map[string]bool{} for _, chainID := range req.ChainIds { if len(chainID) == 0 { return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") } + + // check for duplicates + if encountered[chainID] { + return nil, status.Errorf(codes.InvalidArgument, "duplicate chain ID %s", chainID) + } else { + encountered[chainID] = true + } } ctx := sdk.UnwrapSDKContext(c) From e36eaf6efcf5fd6fa1f4f9a6638c1bdfc82f8612 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 12:18:42 +0530 Subject: [PATCH 18/21] improve comments --- x/zoneconcierge/keeper/grpc_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 723a22dc6..8acc2efd4 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -60,7 +60,7 @@ func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") } - // check for duplicates + // check for duplicates and return error on first duplicate found if encountered[chainID] { return nil, status.Errorf(codes.InvalidArgument, "duplicate chain ID %s", chainID) } else { From fa511e9883352394367370c97c05e4b4d6638862 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 14:40:31 +0530 Subject: [PATCH 19/21] add e2e test --- test/e2e/configurer/chain/queries.go | 10 ++++++++++ test/e2e/e2e_test.go | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/test/e2e/configurer/chain/queries.go b/test/e2e/configurer/chain/queries.go index f3e44d8d4..58af85ccb 100644 --- a/test/e2e/configurer/chain/queries.go +++ b/test/e2e/configurer/chain/queries.go @@ -209,6 +209,16 @@ func (n *NodeConfig) QueryCheckpointChains() (*[]string, error) { return &chainsResponse.ChainIds, nil } +func (n *NodeConfig) QueryCheckpointChainsInfo(chainID string) ([]*zctypes.ChainInfo, error) { + bz, err := n.QueryGRPCGateway("/babylon/zoneconcierge/v1/chains_info", "chain_ids", chainID) + require.NoError(n.t, err) + var infoResponse zctypes.QueryChainsInfoResponse + if err := util.Cdc.UnmarshalJSON(bz, &infoResponse); err != nil { + return nil, err + } + return infoResponse.ChainsInfo, nil +} + func (n *NodeConfig) QueryCurrentEpoch() (uint64, error) { bz, err := n.QueryGRPCGateway("/babylon/epoching/v1/current_epoch") require.NoError(n.t, err) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index e1344e622..e70e0b01a 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -29,6 +29,11 @@ func (s *IntegrationTestSuite) TestIbcCheckpointing() { nonValidatorNode, err := chainA.GetNodeAtIndex(2) s.NoError(err) + // Query checkpoint chain info for opposing chain + chainInfo, err := nonValidatorNode.QueryCheckpointChainsInfo(initialization.ChainBID) + s.NoError(err) + s.Equal(chainInfo[0].ChainId, initialization.ChainBID) + // Finalize epoch 1,2,3 , as first headers of opposing chain are in epoch 3 nonValidatorNode.FinalizeSealedEpochs(1, 3) From beecb9e69111173ddb9ffaa6b55f21a47d0d0e0e Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 15:00:34 +0530 Subject: [PATCH 20/21] update protover --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 272a682c1..e11f83853 100644 --- a/Makefile +++ b/Makefile @@ -363,7 +363,7 @@ devdoc-update: ### Protobuf ### ############################################################################### -protoVer=0.12.0 +protoVer=0.12.1 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) From 39a92975952124a48e04ed07906e7f0e1d070b81 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Thu, 27 Apr 2023 15:03:29 +0530 Subject: [PATCH 21/21] revert back to 12.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e11f83853..272a682c1 100644 --- a/Makefile +++ b/Makefile @@ -363,7 +363,7 @@ devdoc-update: ### Protobuf ### ############################################################################### -protoVer=0.12.1 +protoVer=0.12.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)